]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OpenID/OpenIDPlugin.php
Squashed commit of the following:
[quix0rs-gnu-social.git] / plugins / OpenID / OpenIDPlugin.php
index ed6d6534c09dbdaff0ebef609fabd235cee9b628..d5c5c303c232f4a66fc545e55402d6f5d5056662 100644 (file)
@@ -814,4 +814,30 @@ class OpenIDPlugin extends Plugin
 
         return true;
     }
+
+    /**
+     * Add links in the user's profile block to their OpenID URLs.
+     *
+     * @param Profile $profile The profile being shown
+     * @param Array   &$links  Writeable array of arrays (href, text, image).
+     *
+     * @return boolean hook value (true)
+     */
+    
+    function onOtherAccountProfiles($profile, &$links)
+    {
+        $oid = new User_openid();
+
+        $oid->user_id = $profile->id;
+
+        if ($oid->find()) {
+            while ($oid->fetch()) {
+                $links[] = array('href' => $oid->display,
+                                 'text' => _('OpenID'),
+                                 'image' => $this->path("icons/openid-16x16.gif"));
+            }
+        }
+
+        return true;
+    }
 }