X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Flogin.php;h=5544fd8786a4ea79ccb6553075391234731228e5;hb=d0559fdf4dafcaf8446b437f4af089c944a23d09;hp=ae1c7e7af4191dc3541a2837efa246bf0043ec6e;hpb=d605cee2230b6d8d7e1ceefa1eac2dcb3b92da90;p=quix0rs-gnu-social.git diff --git a/actions/login.php b/actions/login.php index ae1c7e7af4..5544fd8786 100644 --- a/actions/login.php +++ b/actions/login.php @@ -1,18 +1,18 @@ . */ @@ -20,7 +20,7 @@ if (!defined('LACONICA')) { exit(1); } class LoginAction extends Action { - + function handle($args) { parent::handle($args); if (common_logged_in()) { @@ -43,20 +43,30 @@ class LoginAction extends Action { common_server_error(_t('Error setting user.')); return; } - # success! - common_redirect(common_local_url('all', - array('nickname' => - $nickname))); + # success! + $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); + if ($error) { + common_element('div', array('class' => 'error'), $error); + } else { + common_element('div', 'instructions', + _t('Login with your username and password. ' . + 'Don\'t have a username yet? Choose register above. ')); } common_element_start('form', array('method' => 'POST', 'id' => 'login',