summaryrefslogtreecommitdiff
path: root/plugins/OpenID/OpenIDPlugin.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-04 13:17:43 -0400
committerEvan Prodromou <evan@controlyourself.ca>2009-08-04 13:17:43 -0400
commit622c0b24c3455557bdb1bee646dcd9c955a3b3ea (patch)
treeefb03f2f7378562cf5e9f367f5c4f27ca9cfacea /plugins/OpenID/OpenIDPlugin.php
parent000e21be1917b190a2aaca2e864bbf79de4796bb (diff)
move redirect-to-openid code to OpenID plugin
Diffstat (limited to 'plugins/OpenID/OpenIDPlugin.php')
-rw-r--r--plugins/OpenID/OpenIDPlugin.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/plugins/OpenID/OpenIDPlugin.php b/plugins/OpenID/OpenIDPlugin.php
index a395f9107..ec261d7f7 100644
--- a/plugins/OpenID/OpenIDPlugin.php
+++ b/plugins/OpenID/OpenIDPlugin.php
@@ -156,4 +156,19 @@ class OpenIDPlugin extends Plugin
$action->element('meta', array('http-equiv' => 'X-XRDS-Location',
'content' => common_local_url('publicxrds')));
}
+
+ /**
+ * Redirect to OpenID login if they have an OpenID
+ *
+ * @return boolean whether to continue
+ */
+
+ function onRedirectToLogin($action, $user)
+ {
+ if (!empty($user) && User_openid::hasOpenID($user->id)) {
+ common_redirect(common_local_url('openidlogin'), 303);
+ return false;
+ }
+ return true;
+ }
}