X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Flogin.php;h=5acb157f4f0315ebdb16c8d7276b111e7e524243;hb=676bbebe1a6225d77416a0e3ea57a90b25627ced;hp=9f9c473b513d3436316f8b0dd9035f405ca47fda;hpb=52600ce0b063e68e622b19699841e41b5ddbf2d1;p=quix0rs-gnu-social.git diff --git a/actions/login.php b/actions/login.php index 9f9c473b51..5acb157f4f 100644 --- a/actions/login.php +++ b/actions/login.php @@ -44,20 +44,23 @@ class LoginAction extends Action { return; } # success! - common_redirect(common_local_url('all', - array('nickname' => - $nickname))); + $url = common_get_returnto(); + if ($url) { + # We don't have to return to it again + common_set_returnto(NULL); + } else { + $url = common_local_url('all', + array('nickname' => + $nickname)); + } + common_redirect($url); } else { $this->show_form(_t('Incorrect username or password.')); } } function show_form($error=NULL) { - - common_show_header(_t('Login')); - if (!is_null($error)) { - common_element('div', array('class' => 'error'), $msg); - } + common_show_header(_t('Login'), NULL, $error, array($this, 'show_top')); common_element_start('form', array('method' => 'POST', 'id' => 'login', 'action' => common_local_url('login'))); @@ -67,4 +70,14 @@ class LoginAction extends Action { common_element_end('form'); common_show_footer(); } + + 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. ')); + } + } }