X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Flogin.php;h=50de83f6fb2574dc2627c2c3b87da9785110ba3a;hb=b4e649fe906a793cd5e62d6390065ea5d41c40db;hp=98cc8a855fbd65102f6cce5416b7a3a07acc1709;hpb=2bd52059dbcc2ece561daba73963c66d410ad89e;p=quix0rs-gnu-social.git diff --git a/actions/login.php b/actions/login.php index 98cc8a855f..50de83f6fb 100644 --- a/actions/login.php +++ b/actions/login.php @@ -55,7 +55,7 @@ class LoginAction extends Action * @return boolean false */ - function isReadOnly() + function isReadOnly($args) { return false; } @@ -78,6 +78,7 @@ class LoginAction extends Action } else if ($_SERVER['REQUEST_METHOD'] == 'POST') { $this->checkLogin(); } else { + common_ensure_session(); $this->showForm(); } } @@ -107,13 +108,15 @@ class LoginAction extends Action $nickname = common_canonical_nickname($this->trimmed('nickname')); $password = $this->arg('password'); - if (!common_check_user($nickname, $password)) { + $user = common_check_user($nickname, $password); + + if (!$user) { $this->showForm(_('Incorrect username or password.')); return; } // success! - if (!common_set_user($nickname)) { + if (!common_set_user($user)) { $this->serverError(_('Error setting user.')); return; } @@ -135,7 +138,7 @@ class LoginAction extends Action $nickname)); } - common_redirect($url); + common_redirect($url, 303); } /**