summaryrefslogtreecommitdiff
path: root/actions/openidlogin.php
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2009-08-13 22:18:06 +0800
committerJeffery To <jeffery.to@gmail.com>2009-08-13 22:18:06 +0800
commit7dc3a90d1252137859a687e32313ea569dcf8796 (patch)
tree8da73e6ca6f22a8e08c0126b5521e74d77005f45 /actions/openidlogin.php
parent853b6d38b362e3a905195d9ff850c9a884d412bd (diff)
Added a configuration option to disable OpenID.
If $config['openid']['enabled'] is set to false, OpenID is removed from the navigation and direct accesses to OpenID login pages redirect to the login page. If OpenID is enabled, $config['site']['openidonly'] is ignored, i.e. OpenID is required to go OpenID-only.
Diffstat (limited to 'actions/openidlogin.php')
-rw-r--r--actions/openidlogin.php4
1 files changed, 3 insertions, 1 deletions
diff --git a/actions/openidlogin.php b/actions/openidlogin.php
index a8d052096..744aae713 100644
--- a/actions/openidlogin.php
+++ b/actions/openidlogin.php
@@ -26,7 +26,9 @@ class OpenidloginAction extends Action
function handle($args)
{
parent::handle($args);
- if (common_is_real_login()) {
+ if (!common_config('openid', 'enabled')) {
+ common_redirect(common_local_url('login'));
+ } else if (common_is_real_login()) {
$this->clientError(_('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$openid_url = $this->trimmed('openid_url');