diff options
author | Andreas Gohr <andi@splitbrain.org> | 2013-04-19 09:28:22 +0200 |
---|---|---|
committer | Andreas Gohr <andi@splitbrain.org> | 2013-04-19 09:28:22 +0200 |
commit | a426a6cd90e703479b2f5a57d16b97d5ded495af (patch) | |
tree | 73ce98faa92382ba61ae1573984012c3c7bb5b44 /lib/plugins/authldap | |
parent | 0fb6b47f24d6914847f97a98b1598e9af7dab99b (diff) | |
download | rpg-a426a6cd90e703479b2f5a57d16b97d5ded495af.tar.gz rpg-a426a6cd90e703479b2f5a57d16b97d5ded495af.tar.bz2 |
LDAP: do not bind anonymously if superuser is set FS#2607
Diffstat (limited to 'lib/plugins/authldap')
-rw-r--r-- | lib/plugins/authldap/auth.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index 6e7bde1f0..b49aa4792 100644 --- a/lib/plugins/authldap/auth.php +++ b/lib/plugins/authldap/auth.php @@ -465,7 +465,13 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { if(defined('LDAP_OPT_NETWORK_TIMEOUT')) { ldap_set_option($this->con, LDAP_OPT_NETWORK_TIMEOUT, 1); } - $bound = @ldap_bind($this->con); + + if($this->getConf('binddn') && $this->getConf('bindpw')) { + $bound = @ldap_bind($this->con, $this->getConf('binddn'), $this->getConf('bindpw')); + $this->bound = 2; + } else { + $bound = @ldap_bind($this->con); + } if($bound) { break; } |