summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
Diffstat (limited to 'actions')
-rw-r--r--actions/noticesearch.php2
-rw-r--r--actions/othersettings.php38
-rw-r--r--actions/passwordsettings.php4
-rw-r--r--actions/xrds.php24
4 files changed, 31 insertions, 37 deletions
diff --git a/actions/noticesearch.php b/actions/noticesearch.php
index 1e5a69180..76c877ff2 100644
--- a/actions/noticesearch.php
+++ b/actions/noticesearch.php
@@ -121,7 +121,7 @@ class NoticesearchAction extends SearchAction
$message = sprintf(_('Be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
}
else {
- $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
+ $message = sprintf(_('Why not [register an account](%%%%action.register%%%%) and be the first to [post on this topic](%%%%action.newnotice%%%%?status_textarea=%s)!'), urlencode($q));
}
$this->elementStart('div', 'guide');
diff --git a/actions/othersettings.php b/actions/othersettings.php
index d32a2d651..0de7cd908 100644
--- a/actions/othersettings.php
+++ b/actions/othersettings.php
@@ -96,28 +96,28 @@ class OthersettingsAction extends AccountSettingsAction
common_local_url('othersettings')));
$this->elementStart('fieldset');
$this->hidden('token', common_session_token());
+ $this->elementStart('ul', 'form_data');
- $services=array();
- global $_shorteners;
- if($_shorteners){
- foreach($_shorteners as $name=>$value)
- {
- $services[$name]=$name;
- if(!empty($value['info']['freeService'])){
- // I18N
- $services[$name].=' (free service)';
- }
+ $shorteners = array();
+ Event::handle('GetUrlShorteners', array(&$shorteners));
+ $services = array();
+ foreach($shorteners as $name=>$value)
+ {
+ $services[$name]=$name;
+ if($value['freeService']){
+ $services[$name].=_(' (free service)');
}
}
- asort($services);
- $services['']='None';
-
- $this->elementStart('ul', 'form_data');
- $this->elementStart('li');
- $this->dropdown('urlshorteningservice', _('Shorten URLs with'),
- $services, _('Automatic shortening service to use.'),
- false, $user->urlshorteningservice);
- $this->elementEnd('li');
+ if($services)
+ {
+ asort($services);
+
+ $this->elementStart('li');
+ $this->dropdown('urlshorteningservice', _('Shorten URLs with'),
+ $services, _('Automatic shortening service to use.'),
+ false, $user->urlshorteningservice);
+ $this->elementEnd('li');
+ }
$this->elementStart('li');
$this->checkbox('viewdesigns', _('View profile designs'),
$user->viewdesigns, _('Show or hide profile designs.'));
diff --git a/actions/passwordsettings.php b/actions/passwordsettings.php
index 9e79501e2..11d7bf785 100644
--- a/actions/passwordsettings.php
+++ b/actions/passwordsettings.php
@@ -170,7 +170,7 @@ class PasswordsettingsAction extends AccountSettingsAction
}
$success = false;
- if(! Event::handle('StartChangePassword', array($user->nickname, $oldpassword, $newpassword))){
+ if(! Event::handle('StartChangePassword', array($user, $oldpassword, $newpassword))){
//no handler changed the password, so change the password internally
$original = clone($user);
@@ -186,7 +186,7 @@ class PasswordsettingsAction extends AccountSettingsAction
$this->serverError(_('Can\'t save new password.'));
return;
}
- Event::handle('EndChangePassword', array($nickname));
+ Event::handle('EndChangePassword', array($user));
}
$this->showForm(_('Password saved.'), true);
diff --git a/actions/xrds.php b/actions/xrds.php
index 8f09557d1..534182e3e 100644
--- a/actions/xrds.php
+++ b/actions/xrds.php
@@ -97,27 +97,23 @@ class XrdsAction extends Action
$xrdsOutputter->element('Type', null, 'xri://$xrds*simple');
$xrdsOutputter->showXrdsService(OAUTH_ENDPOINT_REQUEST,
common_local_url('requesttoken'),
- array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1));
- $xrdsOutputter->showXrdsService( OAUTH_ENDPOINT_AUTHORIZE,
- common_local_url('userauthorization'),
array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1),
null,
- $this->user->getIdentifierURI());
+ $this->user->uri);
+ $xrdsOutputter->showXrdsService( OAUTH_ENDPOINT_AUTHORIZE,
+ common_local_url('userauthorization'),
+ array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1));
$xrdsOutputter->showXrdsService(OAUTH_ENDPOINT_ACCESS,
common_local_url('accesstoken'),
- array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1),
- null,
- $this->user->getIdentifierURI());
+ array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1));
$xrdsOutputter->showXrdsService(OAUTH_ENDPOINT_RESOURCE,
null,
- array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1),
- null,
- $this->user->getIdentifierURI());
+ array(OAUTH_AUTH_HEADER, OAUTH_POST_BODY, OAUTH_HMAC_SHA1));
$xrdsOutputter->elementEnd('XRD');
//omb
$xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
- 'xml:id' => 'oauth',
+ 'xml:id' => 'omb',
'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
'version' => '2.0'));
$xrdsOutputter->element('Type', null, 'xri://$xrds*simple');
@@ -127,10 +123,10 @@ class XrdsAction extends Action
common_local_url('updateprofile'));
$xrdsOutputter->elementEnd('XRD');
+ Event::handle('EndUserXRDS', array($this,&$xrdsOutputter));
+
//misc
$xrdsOutputter->elementStart('XRD', array('xmlns' => 'xri://$xrd*($v*2.0)',
- 'xml:id' => 'oauth',
- 'xmlns:simple' => 'http://xrds-simple.net/core/1.0',
'version' => '2.0'));
$xrdsOutputter->showXrdsService(OAUTH_DISCOVERY,
'#oauth');
@@ -138,8 +134,6 @@ class XrdsAction extends Action
'#omb');
$xrdsOutputter->elementEnd('XRD');
- Event::handle('EndUserXRDS', array($this,&$xrdsOutputter));
-
$xrdsOutputter->endXRDS();
}