]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/login.php
Check for config file when running
[quix0rs-gnu-social.git] / actions / login.php
index 98cc8a855fbd65102f6cce5416b7a3a07acc1709..b049791fb1858dac3d79625317efa0ae77bb5bd9 100644 (file)
@@ -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;
         }