diff options
Diffstat (limited to 'actions')
-rw-r--r-- | actions/accesstoken.php | 6 | ||||
-rw-r--r-- | actions/finishimmediate.php | 8 | ||||
-rw-r--r-- | actions/login.php | 19 | ||||
-rw-r--r-- | actions/newnotice.php | 9 | ||||
-rw-r--r-- | actions/publicxrds.php | 12 | ||||
-rw-r--r-- | actions/register.php | 4 | ||||
-rw-r--r-- | actions/remotesubscribe.php | 2 | ||||
-rw-r--r-- | actions/showstream.php | 8 |
8 files changed, 37 insertions, 31 deletions
diff --git a/actions/accesstoken.php b/actions/accesstoken.php index 1c1db8fbc..80c4477d0 100644 --- a/actions/accesstoken.php +++ b/actions/accesstoken.php @@ -27,12 +27,12 @@ class AccesstokenAction extends Action { try { common_debug('getting request from env variables', __FILE__); $req = OAuthRequest::from_request(); - common_debug('getting a server', __FILE__); + common_debug('getting a server', __FILE__); $server = omb_oauth_server(); - common_debug('fetching the access token', __FILE__); + common_debug('fetching the access token', __FILE__); $token = $server->fetch_access_token($req); common_debug('got this token: "'.print_r($token,TRUE).'"', __FILE__); - common_debug('printing the access token', __FILE__); + common_debug('printing the access token', __FILE__); print $token; } catch (OAuthException $e) { common_server_error($e->getMessage()); diff --git a/actions/finishimmediate.php b/actions/finishimmediate.php index 99c868f46..6dbaa3d1c 100644 --- a/actions/finishimmediate.php +++ b/actions/finishimmediate.php @@ -25,7 +25,7 @@ class FinishimmediateAction extends Action { function handle($args) { parent::handle($args); - + $consumer = oid_consumer(); $response = $consumer->complete(common_local_url('finishimmediate')); @@ -36,7 +36,7 @@ class FinishimmediateAction extends Action { $response->endpoint->canonicalID : $response->getDisplayIdentifier(); $user = oid_get_user($canonical); - + if ($user) { oid_update_user($user, $sreg); oid_set_last($display); # refresh for another year @@ -47,12 +47,12 @@ class FinishimmediateAction extends Action { } # Failure! Clear openid so we don't try it again - + oid_clear_last(); $this->go_backto(); return; } - + function go_backto() { common_ensure_session(); $backto = $_SESSION['openid_immediate_backto']; diff --git a/actions/login.php b/actions/login.php index 400957e05..649f7ec9a 100644 --- a/actions/login.php +++ b/actions/login.php @@ -31,7 +31,7 @@ class LoginAction extends Action { $this->show_form(); } } - + function check_login() { # XXX: form token in $_SESSION to prevent XSS # XXX: login throttle @@ -40,7 +40,7 @@ class LoginAction extends Action { if (common_check_user($nickname, $password)) { # success! if (!common_set_user($nickname)) { - common_server_error(_t('Error setting user.')); + common_server_error(_('Error setting user.')); return; } common_real_login(true); @@ -60,11 +60,18 @@ class LoginAction extends Action { } common_redirect($url); } else { - $this->show_form(_t('Incorrect username or password.')); + $this->show_form(_('Incorrect username or password.')); + return; + } + + # success! + if (!common_set_user($user)) { + common_server_error(_t('Error setting user.')); + return; } - + common_real_login(true); - + if ($this->boolean('rememberme')) { common_debug('Adding rememberme cookie for ' . $nickname); common_rememberme($user); @@ -102,7 +109,7 @@ class LoginAction extends Action { } function get_instructions() { - return _t('Login with your username and password. ' . + return _('Login with your username and password. ' . 'Don\'t have a username yet? ' . '[Register](%%action.register%%) a new account, or ' . 'try [OpenID](%%action.openidlogin%%). '); diff --git a/actions/newnotice.php b/actions/newnotice.php index de8e9ec27..107665fb7 100644 --- a/actions/newnotice.php +++ b/actions/newnotice.php @@ -90,7 +90,14 @@ class NewnoticeAction extends Action { function show_form($msg=NULL) { $content = $this->trimmed('status_textarea'); - common_show_header(_t('New notice'), NULL, $content, + if (!$content) { + $replyto = $this->trimmed('replyto'); + $profile = Profile::staticGet('nickname', $replyto); + if ($profile) { + $content = '@' . $profile->nickname . ' '; + } + } + common_show_header(_('New notice'), NULL, $content, array($this, 'show_top')); if ($msg) { common_element('p', 'error', $msg); diff --git a/actions/publicxrds.php b/actions/publicxrds.php index c41c3b2a8..29c8e1314 100644 --- a/actions/publicxrds.php +++ b/actions/publicxrds.php @@ -26,14 +26,14 @@ require_once(INSTALLDIR.'/lib/openid.php'); class PublicxrdsAction extends Action { function handle($args) { - + parent::handle($args); - + header('Content-Type: application/xrds+xml'); common_start_xml(); common_element_start('XRDS', array('xmlns' => 'xri://$xrds')); - + common_element_start('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)', 'xmlns:simple' => 'http://xrds-simple.net/core/1.0', 'version' => '2.0')); @@ -44,13 +44,13 @@ class PublicxrdsAction extends Action { $this->show_service(Auth_OpenID_RP_RETURN_TO_URL_TYPE, common_local_url($finish)); } - + common_element_end('XRD'); - + common_element_end('XRDS'); common_end_xml(); } - + function show_service($type, $uri, $params=NULL, $sigs=NULL, $localId=NULL) { common_element_start('Service'); if ($uri) { diff --git a/actions/register.php b/actions/register.php index 0ee332f0f..45446dce6 100644 --- a/actions/register.php +++ b/actions/register.php @@ -68,7 +68,7 @@ class RegisterAction extends Action { if (!$user) { $this->show_form(_t('Invalid username or password.')); return; - } + } # success! if (!common_set_user($user)) { common_server_error(_('Error setting user.')); @@ -82,7 +82,7 @@ class RegisterAction extends Action { } common_redirect(common_local_url('profilesettings')); } else { - $this->show_form(_t('Invalid username or password.')); + $this->show_form(_('Invalid username or password.')); } } diff --git a/actions/remotesubscribe.php b/actions/remotesubscribe.php index a37ca8c3f..fca8a71ea 100644 --- a/actions/remotesubscribe.php +++ b/actions/remotesubscribe.php @@ -64,7 +64,7 @@ class RemotesubscribeAction extends Action { $profile = $this->trimmed('profile_url'); common_show_header(_('Remote subscribe'), NULL, $err, array($this, 'show_top')); - # id = remotesubscribe conflicts with the + # id = remotesubscribe conflicts with the # button on profile page common_element_start('form', array('id' => 'remsub', 'method' => 'post', 'action' => common_local_url('remotesubscribe'))); diff --git a/actions/showstream.php b/actions/showstream.php index d1d040a27..2a2d9d3b4 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -375,14 +375,6 @@ class ShowstreamAction extends StreamAction { 'href' => $noticeurl, 'title' => common_exact_date($notice->created)), common_date_string($notice->created)); - if ($notice->reply_to) { - $replyurl = common_local_url('shownotice', array('notice' => $notice->reply_to)); - common_text(' ('); - common_element('a', array('class' => 'inreplyto', - 'href' => $replyurl), - _t('in reply to...')); - common_text(')'); - } common_element_start('a', array('href' => common_local_url('newnotice', array('replyto' => $profile->nickname)), |