]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/login.php
don't do an end tag for empty elements
[quix0rs-gnu-social.git] / actions / login.php
index 83fa3ed23c262f9f7a09f7a5166ad1c6c1bfb8f0..93661973287bc5ef74e8f7d8240a3de1e55afb3f 100644 (file)
@@ -45,6 +45,7 @@ class LoginAction extends Action {
                        }
                        common_real_login(true);
                        if ($this->boolean('rememberme')) {
+                               common_debug('Adding rememberme cookie for ' . $nickname);
                                common_rememberme();
                        }
                        # success!
@@ -65,12 +66,12 @@ class LoginAction extends Action {
 
        function show_form($error=NULL) {
                common_show_header(_t('Login'), NULL, $error, array($this, 'show_top'));
-               common_element_start('form', array('method' => 'POST',
+               common_element_start('form', array('method' => 'post',
                                                                                   'id' => 'login',
                                                                                   'action' => common_local_url('login')));
                common_input('nickname', _t('Nickname'));
                common_password('password', _t('Password'));
-               common_checkbox('rememberme', _t('Remember me'),
+               common_checkbox('rememberme', _t('Remember me'), false,
                                _t('Automatically login in the future; ' .
                                   'not for shared computers!'));
                common_submit('submit', _t('Login'));
@@ -82,13 +83,22 @@ class LoginAction extends Action {
                common_show_footer();
        }
 
+       function get_instructions() {
+               return _t('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) {
                if ($error) {
                        common_element('p', 'error', $error);
                } else {
-                       common_element('p', 'instructions',
-                                                  _t('Login with your username and password. ' .
-                                                         'Don\'t have a username yet? Choose register above. '));
+                       $instr = $this->get_instructions();
+                       $output = common_markup_to_html($instr);
+                       common_element_start('p', 'instructions');
+                       common_raw($output);
+                       common_element_end('p');
                }
        }
 }