]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/login.php
Merge branch '0.9.x' of git@gitorious.org:statusnet/mainline into 0.9.x
[quix0rs-gnu-social.git] / actions / login.php
index 71e4679292c79102dd97f80f6683a655dfef5535..f6d0163105f42675a8667c55411ce4a8c96626e7 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Laconica, the distributed open-source microblogging tool
+ * StatusNet, the distributed open-source microblogging tool
  *
  * Login form
  *
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  * @category  Login
- * @package   Laconica
- * @author    Evan Prodromou <evan@controlyourself.ca>
- * @copyright 2008-2009 Control Yourself, Inc.
+ * @package   StatusNet
+ * @author    Evan Prodromou <evan@status.net>
+ * @author    Sarven Capadisli <csarven@status.net>
+ * @copyright 2008-2009 StatusNet, Inc.
  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link      http://laconi.ca/
+ * @link      http://status.net/
  */
 
-if (!defined('LACONICA')) {
+if (!defined('STATUSNET') && !defined('LACONICA')) {
     exit(1);
 }
 
@@ -35,10 +36,11 @@ if (!defined('LACONICA')) {
  * Login form
  *
  * @category Personal
- * @package  Laconica
- * @author   Evan Prodromou <evan@controlyourself.ca>
+ * @package  StatusNet
+ * @author   Evan Prodromou <evan@status.net>
+ * @author   Sarven Capadisli <csarven@status.net>
  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
- * @link     http://laconi.ca/
+ * @link     http://status.net/
  */
 
 class LoginAction extends Action
@@ -55,7 +57,7 @@ class LoginAction extends Action
      * @return boolean false
      */
 
-    function isReadOnly()
+    function isReadOnly($args)
     {
         return false;
     }
@@ -108,13 +110,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;
         }
@@ -136,7 +140,7 @@ class LoginAction extends Action
                                           $nickname));
         }
 
-        common_redirect($url);
+        common_redirect($url, 303);
     }
 
     /**
@@ -156,6 +160,12 @@ class LoginAction extends Action
         $this->showPage();
     }
 
+    function showScripts()
+    {
+        parent::showScripts();
+        $this->autofocus('nickname');
+    }
+
     /**
      * Title of the page
      *
@@ -248,8 +258,7 @@ class LoginAction extends Action
         } else {
             return _('Login with your username and password. ' .
                      'Don\'t have a username yet? ' .
-                     '[Register](%%action.register%%) a new account, or ' .
-                     'try [OpenID](%%action.openidlogin%%). ');
+                     '[Register](%%action.register%%) a new account.');
         }
     }