$user = User::getSilent($login);
- if (!is_null($user) && S::suid()) {
- $success = (S::suid('uid') == $user->id());
+ if (is_null($user)) {
+ Platal::page()->trigError(self::TEXT_INVALID_LOGIN);
+ $success = false;
} else {
- $success = $this->checkPassword($login, $user, Post::v('response'));
+ if (S::suid()) {
+ $success = (S::suid('uid') == $user->id());
+ } else {
+ $success = $this->checkPassword($login, $user, Post::v('response'));
+ }
}
if ($success) {
- S::set('auth', AUTH_MDP);
+ S::set('auth', AUTH_PASSWD);
S::kill('challenge');
S::logger($user->id())->log('auth_ok');
}
return true;
}
if ($level == AUTH_SUID) {
- S::set('auth', AUTH_MDP);
+ S::set('auth', AUTH_PASSWD);
}
// Loads uid and hruid into the session for developement conveniance.
public function sureLevel()
{
- return AUTH_MDP;
+ return AUTH_PASSWD;
}