本文整理汇总了PHP中DatabaseHandler::authenticate_user方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseHandler::authenticate_user方法的具体用法?PHP DatabaseHandler::authenticate_user怎么用?PHP DatabaseHandler::authenticate_user使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseHandler
的用法示例。
在下文中一共展示了DatabaseHandler::authenticate_user方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$detail = 'No email parameter.';
// explanation of problem
$errorMessages[] = array('id' => $id++, 'status' => $status, 'code' => $code, 'title' => $title, 'detail' => $detail);
}
if (!isset($_POST['password'])) {
$showStopperError = true;
$code = 2;
// Missing required authentication parameter
$title = 'Missing required authentication parameters.';
// summary of problem
$detail = 'No password parameter.';
// explanation of problem
$errorMessages[] = array('id' => $id++, 'status' => $status, 'code' => $code, 'title' => $title, 'detail' => $detail);
}
if (!$showStopperError) {
$userId = $db->authenticate_user($_POST['schoolemail'], md5($_POST['password']));
//echo $outcome.' is userId.<br>';
if ($userId) {
$isAuthenticated = true;
//echo $_POST['email'].' is authenticated.<br>';
if ($_POST['operation'] == 'authenticate_user') {
// 2: logged in
$activityType = 2;
$itemId = $db->create_activity($userId, $activityType, $userId);
$profile = array('id' => $userId, 'schoolemail' => $_POST['schoolemail'], 'password' => $_POST['password']);
$data = array('profile' => $profile);
print json_encode($data);
}
} else {
//echo $_POST['email'].' is not authenticated.<br>';
$code = 41;