X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOpenID%2FOpenIDPlugin.php;h=2635cb7c9d09211d7b7c2bc26bf60526f586fde1;hb=c0bb1a57984266024e8e5a968c0f3a3b54befff6;hp=cdaabbbf7fd97fa0b7e2adf56508171effece8f2;hpb=307c819089146a83ae3b8f3c21be692cd6297c19;p=quix0rs-gnu-social.git diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php index cdaabbbf7f..2635cb7c9d 100644 --- a/plugins/OpenID/OpenIDPlugin.php +++ b/plugins/OpenID/OpenIDPlugin.php @@ -248,11 +248,11 @@ class OpenIDPlugin extends Plugin * * 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); @@ -268,11 +268,11 @@ class OpenIDPlugin extends Plugin /** * 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); @@ -318,11 +318,11 @@ class OpenIDPlugin extends Plugin /** * 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'); @@ -735,4 +735,29 @@ class OpenIDPlugin extends Plugin 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; + } }