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);
+ 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',