From d75d76b237162cf89dcc8f56703ec0607ed27fdb Mon Sep 17 00:00:00 2001 From: Andreas Gohr Date: Mon, 9 Feb 2015 09:40:24 +0100 Subject: fix referral settings in AuthLDAP. closes #1023 --- lib/plugins/authldap/auth.php | 4 ++-- lib/plugins/authldap/conf/default.php | 2 +- lib/plugins/authldap/conf/metadata.php | 2 +- lib/plugins/authldap/lang/en/settings.php | 4 ++++ 4 files changed, 8 insertions(+), 4 deletions(-) (limited to 'lib/plugins/authldap') diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index fd4729331..50735882f 100644 --- a/lib/plugins/authldap/auth.php +++ b/lib/plugins/authldap/auth.php @@ -516,13 +516,13 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { } } // needs version 3 - if($this->getConf('referrals')) { + if($this->getConf('referrals') > -1) { if(!@ldap_set_option( $this->con, LDAP_OPT_REFERRALS, $this->getConf('referrals') ) ) { - msg('Setting LDAP referrals to off failed', -1); + msg('Setting LDAP referrals failed', -1); $this->_debug('LDAP referal set: '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__); } } diff --git a/lib/plugins/authldap/conf/default.php b/lib/plugins/authldap/conf/default.php index 2c295eeeb..c2e462c5c 100644 --- a/lib/plugins/authldap/conf/default.php +++ b/lib/plugins/authldap/conf/default.php @@ -8,7 +8,7 @@ $conf['userfilter'] = ''; $conf['groupfilter'] = ''; $conf['version'] = 2; $conf['starttls'] = 0; -$conf['referrals'] = 0; +$conf['referrals'] = -1; $conf['deref'] = 0; $conf['binddn'] = ''; $conf['bindpw'] = ''; diff --git a/lib/plugins/authldap/conf/metadata.php b/lib/plugins/authldap/conf/metadata.php index 6aa53c40d..4649ba5bf 100644 --- a/lib/plugins/authldap/conf/metadata.php +++ b/lib/plugins/authldap/conf/metadata.php @@ -7,7 +7,7 @@ $meta['userfilter'] = array('string','_caution' => 'danger'); $meta['groupfilter'] = array('string','_caution' => 'danger'); $meta['version'] = array('numeric','_caution' => 'danger'); $meta['starttls'] = array('onoff','_caution' => 'danger'); -$meta['referrals'] = array('onoff','_caution' => 'danger'); +$meta['referrals'] = array('multichoice','_choices' => array(-1,0,1),'_caution' => 'danger'); $meta['deref'] = array('multichoice','_choices' => array(0,1,2,3),'_caution' => 'danger'); $meta['binddn'] = array('string','_caution' => 'danger'); $meta['bindpw'] = array('password','_caution' => 'danger'); diff --git a/lib/plugins/authldap/lang/en/settings.php b/lib/plugins/authldap/lang/en/settings.php index b73166ab2..951901ccc 100644 --- a/lib/plugins/authldap/lang/en/settings.php +++ b/lib/plugins/authldap/lang/en/settings.php @@ -21,3 +21,7 @@ $lang['deref_o_0'] = 'LDAP_DEREF_NEVER'; $lang['deref_o_1'] = 'LDAP_DEREF_SEARCHING'; $lang['deref_o_2'] = 'LDAP_DEREF_FINDING'; $lang['deref_o_3'] = 'LDAP_DEREF_ALWAYS'; + +$lang['referrals_o_-1'] = 'use default'; +$lang['referrals_o_0'] = 'don\'t follow referrals'; +$lang['referrals_o_1'] = 'follow referrals'; \ No newline at end of file -- cgit v1.2.3