]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/login.php
XMPP daemon updates including help, sub and subsub commands, plus subscribe/unsubcrib...
[quix0rs-gnu-social.git] / actions / login.php
index d84a0b8cb9184e5846704aa4ca77f876fcd3cafb..f183c1cd45c5ab7ff57f84440a0e2f321679fc9d 100644 (file)
@@ -21,6 +21,10 @@ if (!defined('LACONICA')) { exit(1); }
 
 class LoginAction extends Action {
 
+       function is_readonly() {
+               return true;
+       }
+
        function handle($args) {
                parent::handle($args);
                if (common_is_real_login()) {
@@ -35,7 +39,7 @@ class LoginAction extends Action {
        function check_login() {
                # XXX: form token in $_SESSION to prevent XSS
                # XXX: login throttle
-               $nickname = $this->arg('nickname');
+               $nickname = common_canonical_nickname($this->trimmed('nickname'));
                $password = $this->arg('password');
                if (common_check_user($nickname, $password)) {
                        # success!
@@ -109,10 +113,21 @@ class LoginAction extends Action {
        }
 
        function get_instructions() {
-               return _('Login with your username and password. ' .
-                                 'Don\'t have a username yet? ' .
-                                 '[Register](%%action.register%%) a new account, or ' .
-                                 'try [OpenID](%%action.openidlogin%%). ');
+               if (common_logged_in() &&
+                       !common_is_real_login() &&
+                       common_get_returnto())
+               {
+                       # rememberme logins have to reauthenticate before
+                       # changing any profile settings (cookie-stealing protection)
+                       return _('For security reasons, please re-enter your ' .
+                                        'user name and password ' .
+                                        'before changing your settings.');
+               } 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%%). ');
+               }
        }
 
        function show_top($error=NULL) {
@@ -127,4 +142,3 @@ class LoginAction extends Action {
                }
        }
 }
-#
\ No newline at end of file