$m->connect('index.php?action=finishaddopenid',
array('action' => 'finishaddopenid'));
$m->connect('main/openidserver', array('action' => 'openidserver'));
- $m->connect('admin/openid', array('action' => 'openidadminpanel'));
+ $m->connect('panel/openid', array('action' => 'openidadminpanel'));
return true;
}
*
* If we're in openidOnly mode, we disable the menu for all other login.
*
- * @param Action &$action Action being executed
+ * @param Action $action Action being executed
*
* @return boolean hook return
*/
- function onStartLoginGroupNav(&$action)
+ function onStartLoginGroupNav($action)
{
if (common_config('site', 'openidonly')) {
$this->showOpenIDLoginTab($action);
/**
* Menu item for login
*
- * @param Action &$action Action being executed
+ * @param Action $action Action being executed
*
* @return boolean hook return
*/
- function onEndLoginGroupNav(&$action)
+ function onEndLoginGroupNav($action)
{
$this->showOpenIDLoginTab($action);
/**
* Menu item for OpenID settings
*
- * @param Action &$action Action being executed
+ * @param Action $action Action being executed
*
* @return boolean hook return
*/
- function onEndAccountSettingsNav(&$action)
+ function onEndAccountSettingsNav($action)
{
$action_name = $action->trimmed('action');
return true;
}
+ /**
+ * Add OpenID information to the Account Management Control Document
+ * Event supplied by the Account Manager plugin
+ *
+ * @param array &$amcd Array that expresses the AMCD
+ *
+ * @return boolean hook value
+ */
+
+ function onEndAccountManagementControlDocument(&$amcd)
+ {
+ $amcd['auth-methods']['openid'] = array(
+ 'connect' => array(
+ 'method' => 'POST',
+ 'path' => common_local_url('openidlogin'),
+ 'params' => array(
+ 'identity' => 'openid_url'
+ )
+ )
+ );
+ }
+
/**
* Add our version information to output
*
require_once dirname(__FILE__) . '/openid.php';
oid_assert_allowed($openid_url);
- $returnto = common_local_url('apioauthauthorize', array(),
- array('oauth_token' => $action->arg('oauth_token')));
+ $returnto = common_local_url(
+ 'ApiOauthAuthorize',
+ array(),
+ array(
+ 'oauth_token' => $action->arg('oauth_token'),
+ 'mode' => $action->arg('mode')
+ )
+ );
common_set_returnto($returnto);
// This will redirect if functional...
return true;
}
+
+ /**
+ * Add link in user's XRD file to allow OpenID login.
+ *
+ * This link in the XRD should let users log in with their
+ * Webfinger identity to services that support it. See
+ * http://webfinger.org/login for an example.
+ *
+ * @param XRD &$xrd Currently-displaying XRD object
+ * @param User $user The user that it's for
+ *
+ * @return boolean hook value (always true)
+ */
+
+ function onEndXrdActionLinks(&$xrd, $user)
+ {
+ $profile = $user->getProfile();
+
+ if (!empty($profile)) {
+ $xrd->links[] = array('rel' => 'http://specs.openid.net/auth/2.0/provider',
+ 'href' => $profile->profileurl);
+ }
+
+ return true;
+ }
}