summaryrefslogtreecommitdiff
path: root/actions/login.php
diff options
context:
space:
mode:
authorJeffery To <jeffery.to@gmail.com>2009-08-09 19:12:59 +0800
committerJeffery To <jeffery.to@gmail.com>2009-08-10 13:57:39 +0800
commit14b46e2183f10359cc53d597913a878f53e23719 (patch)
tree5abe41f6f475be0a05168f8859542e1a1a3b3b21 /actions/login.php
parentc1b19929f6234c4b9e30e16bae419c89c38c1169 (diff)
Added configuration option to only allow OpenID logins.
If $config['site']['openidonly'] is set to true: * the Login/Register pages will be removed from the navigation; * directly accesses to the Login/Register pages will redirect to the OpenID login page; * most links to the Login/Register pages will link to the OpenID login page instead. The user will still need to set a password to access the API and RSS feeds.
Diffstat (limited to 'actions/login.php')
-rw-r--r--actions/login.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/actions/login.php b/actions/login.php
index 50de83f6f..c20854f15 100644
--- a/actions/login.php
+++ b/actions/login.php
@@ -65,6 +65,8 @@ class LoginAction extends Action
*
* Switches on request method; either shows the form or handles its input.
*
+ * Checks if only OpenID is allowed and redirects to openidlogin if so.
+ *
* @param array $args $_REQUEST data
*
* @return void
@@ -73,7 +75,9 @@ class LoginAction extends Action
function handle($args)
{
parent::handle($args);
- if (common_is_real_login()) {
+ if (common_config('site', 'openidonly')) {
+ common_redirect(common_local_url('openidlogin'));
+ } else if (common_is_real_login()) {
$this->clientError(_('Already logged in.'));
} else if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$this->checkLogin();