本文整理汇总了PHP中Access::log_user_in_ajax方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::log_user_in_ajax方法的具体用法?PHP Access::log_user_in_ajax怎么用?PHP Access::log_user_in_ajax使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::log_user_in_ajax方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: json_encode
echo json_encode(array('result' => true, 'msg' => 'Successfully Logged In', 'extra' => json_encode($customer)));
break;
case 1:
echo json_encode(array('result' => false, 'msg' => "Incorrect Password"));
break;
case 2:
echo json_encode(array('result' => false, 'msg' => "Invalid Email"));
break;
}
} else {
echo json_encode(array('result' => false, 'msg' => "Invalid username or password."));
}
break;
case 'register':
if (isset($_REQUEST['user']) && isset($_REQUEST['pass'])) {
$insert_data = array('Email' => $_REQUEST['user'], 'Password' => Access::create_hash($_REQUEST['pass'], 'strong'));
$dbi->insert('Customers', $insert_data);
Access::log_user_in_ajax($_REQUEST['user'], $_REQUEST['pass']);
echo json_encode(array('result' => true, 'msg' => "Your account has been created", 'extra' => Customer::get_current()));
} else {
echo json_encode(array('result' => false, 'msg' => "Invalid email or password"));
}
break;
default:
$_SESSION['loggedin'] = false;
echo json_encode(array('result' => false, 'code' => '1', 'msg' => "Requested action not defined"));
break;
}
} else {
echo json_encode(array('result' => false, 'msg' => "Error: No action was defined."));
}