summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/accountsettingsaction.php4
-rw-r--r--lib/common.php8
-rw-r--r--lib/logingroupnav.php6
3 files changed, 16 insertions, 2 deletions
diff --git a/lib/accountsettingsaction.php b/lib/accountsettingsaction.php
index 4ab50abce..1a21d871e 100644
--- a/lib/accountsettingsaction.php
+++ b/lib/accountsettingsaction.php
@@ -126,6 +126,10 @@ class AccountSettingsNav extends Widget
$this->action->elementStart('ul', array('class' => 'nav'));
foreach ($menu as $menuaction => $menudesc) {
+ if ($menuaction == 'openidsettings' &&
+ !common_config('openid', 'enabled')) {
+ continue;
+ }
$this->action->menuItem(common_local_url($menuaction),
$menudesc[0],
$menudesc[1],
diff --git a/lib/common.php b/lib/common.php
index f26155e70..3fc047af9 100644
--- a/lib/common.php
+++ b/lib/common.php
@@ -170,6 +170,8 @@ $config =
'host' => null, # only set if != server
'debug' => false, # print extra debug info
'public' => array()), # JIDs of users who want to receive the public stream
+ 'openid' =>
+ array('enabled' => true),
'invite' =>
array('enabled' => true),
'sphinx' =>
@@ -371,6 +373,12 @@ if ($_db_name != 'laconica' && !array_key_exists('ini_'.$_db_name, $config['db']
$config['db']['ini_'.$_db_name] = INSTALLDIR.'/classes/laconica.ini';
}
+// Ignore openidonly if OpenID is disabled
+
+if (!$config['openid']['enabled']) {
+ $config['site']['openidonly'] = false;
+}
+
// XXX: how many of these could be auto-loaded on use?
require_once 'Validate.php';
diff --git a/lib/logingroupnav.php b/lib/logingroupnav.php
index 919fd3db9..2fb1828d6 100644
--- a/lib/logingroupnav.php
+++ b/lib/logingroupnav.php
@@ -80,8 +80,10 @@ class LoginGroupNav extends Widget
_('Sign up for a new account'));
}
}
- $menu['openidlogin'] = array(_('OpenID'),
- _('Login or register with OpenID'));
+ if (common_config('openid', 'enabled')) {
+ $menu['openidlogin'] = array(_('OpenID'),
+ _('Login or register with OpenID'));
+ }
$action_name = $this->action->trimmed('action');
$this->action->elementStart('ul', array('class' => 'nav'));