本文整理汇总了PHP中error::createLoginFailedSuspendedError方法的典型用法代码示例。如果您正苦于以下问题:PHP error::createLoginFailedSuspendedError方法的具体用法?PHP error::createLoginFailedSuspendedError怎么用?PHP error::createLoginFailedSuspendedError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类error
的用法示例。
在下文中一共展示了error::createLoginFailedSuspendedError方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userLogin
/**
* Log into the site
*
* @uses $CFG
* @param string $email
* @param string $password
* @return User object if successful else Error object
*/
function userLogin($email, $password)
{
global $CFG, $ERROR;
clearSession();
/** Just in case **/
if ($password == "" || $email == "") {
$ERROR = new error();
$ERROR->createLoginFailedError();
return $ERROR;
}
$user = new User();
$user->setEmail($email);
$user = $user->getByEmail();
if ($user instanceof User) {
// make sure this user is an active user
$status = $user->getStatus();
if ($status == $CFG->USER_STATUS_ACTIVE || $status == $CFG->USER_STATUS_REPORTED) {
if (strcmp($user->getAuthType(), $CFG->AUTH_TYPE_EVHUB) == 0) {
$passwordCheck = $user->validPassword($password);
if ($passwordCheck) {
createSession($user);
$user->resetInvitationCode();
// hang over from Cohere groups code
$user->load();
return $user;
} else {
$ERROR = new error();
$ERROR->createLoginFailedError();
return $ERROR;
}
} else {
$ERROR = new error();
$provider = ucfirst($user->getAuthType());
$ERROR->createLoginFailedExternalError($provider);
return $ERROR;
}
} else {
$ERROR = new error();
if ($status == $CFG->USER_STATUS_UNAUTHORIZED) {
$ERROR->createLoginFailedUnauthorizedError();
} else {
if ($status == $CFG->USER_STATUS_SUSPENDED) {
$ERROR->createLoginFailedSuspendedError();
} else {
if ($status == $CFG->USER_STATUS_UNVALIDATED) {
$ERROR->createLoginFailedUnvalidatedError();
} else {
$ERROR->createAccessDeniedError();
}
}
}
return $ERROR;
}
} else {
$ERROR = new error();
$ERROR->createLoginFailedError();
return $ERROR;
}
}