From e0c26282a603881e8d2f839d94c28dbbfc57d71b Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 03:34:17 +0200 Subject: scrutinizer documentations issues --- lib/plugins/authldap/auth.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'lib/plugins/authldap/auth.php') diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index b22b82ecc..a94c7a357 100644 --- a/lib/plugins/authldap/auth.php +++ b/lib/plugins/authldap/auth.php @@ -564,15 +564,13 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { * Wraps around ldap_search, ldap_list or ldap_read depending on $scope * * @author Andreas Gohr - * @param resource $link_identifier - * @param string $base_dn - * @param string $filter - * @param string $scope can be 'base', 'one' or 'sub' - * @param null $attributes - * @param int $attrsonly - * @param int $sizelimit - * @param int $timelimit - * @param int $deref + * @param resource $link_identifier + * @param string $base_dn + * @param string $filter + * @param string $scope can be 'base', 'one' or 'sub' + * @param null|array $attributes + * @param int $attrsonly + * @param int $sizelimit * @return resource */ protected function _ldapsearch($link_identifier, $base_dn, $filter, $scope = 'sub', $attributes = null, -- cgit v1.2.3 From 59bc3b48fdffb76ee65a4b630be3ffa1f6c20c80 Mon Sep 17 00:00:00 2001 From: Gerrit Uitslag Date: Mon, 29 Sep 2014 21:45:27 +0200 Subject: more scrutinizer issue improvements --- lib/plugins/authldap/auth.php | 1 + 1 file changed, 1 insertion(+) (limited to 'lib/plugins/authldap/auth.php') diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index a94c7a357..fd4729331 100644 --- a/lib/plugins/authldap/auth.php +++ b/lib/plugins/authldap/auth.php @@ -181,6 +181,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { } } + $info = array(); $info['user'] = $user; $info['server'] = $this->getConf('server'); -- cgit v1.2.3 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 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/plugins/authldap/auth.php') 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__); } } -- cgit v1.2.3 From 6619ddf4b04390e1d1273dd79bd16bfb9eb6cf89 Mon Sep 17 00:00:00 2001 From: Sascha Klopp Date: Tue, 3 Mar 2015 11:09:21 +0100 Subject: Two new authldap config options: 'userkey' denotes the LDAP attribute holding the username, 'modPass' allows to disable password changing by the user. --- lib/plugins/authldap/auth.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/plugins/authldap/auth.php') diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index 50735882f..9d031c049 100644 --- a/lib/plugins/authldap/auth.php +++ b/lib/plugins/authldap/auth.php @@ -37,7 +37,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { } // Add the capabilities to change the password - $this->cando['modPass'] = true; + $this->cando['modPass'] = $this->getConf('modPass'); } /** @@ -360,8 +360,9 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { $sr = ldap_search($this->con, $this->getConf('usertree'), $all_filter); $entries = ldap_get_entries($this->con, $sr); $users_array = array(); + $userkey = $this->getConf('userkey'); for($i = 0; $i < $entries["count"]; $i++) { - array_push($users_array, $entries[$i]["uid"][0]); + array_push($users_array, $entries[$i][$userkey][0]); } asort($users_array); $result = $users_array; -- cgit v1.2.3 From 8f03c311f28eaffe92893ec1a4d0b78581926e13 Mon Sep 17 00:00:00 2001 From: Patrick Brown Date: Wed, 6 May 2015 15:31:08 -0400 Subject: Error reporting for database auth plugins --- lib/plugins/authldap/auth.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/plugins/authldap/auth.php') diff --git a/lib/plugins/authldap/auth.php b/lib/plugins/authldap/auth.php index 9d031c049..247a0fec2 100644 --- a/lib/plugins/authldap/auth.php +++ b/lib/plugins/authldap/auth.php @@ -281,14 +281,14 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { // open the connection to the ldap if(!$this->_openLDAP()){ - msg('LDAP cannot connect: '. htmlspecialchars(ldap_error($this->con))); + $this->_debug('LDAP cannot connect: '. htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__); return false; } // find the information about the user, in particular the "dn" $info = $this->getUserData($user,true); if(empty($info['dn'])) { - msg('LDAP cannot find your user dn'); + $this->_debug('LDAP cannot find your user dn', 0, __LINE__, __FILE__); return false; } $dn = $info['dn']; @@ -301,7 +301,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { // bind with the ldap if(!@ldap_bind($this->con, $dn, $pass)){ - msg('LDAP user bind failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__); + $this->_debug('LDAP user bind failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__); return false; } } elseif ($this->getConf('binddn') && $this->getConf('bindpw')) { @@ -322,7 +322,7 @@ class auth_plugin_authldap extends DokuWiki_Auth_Plugin { // change the password if(!@ldap_mod_replace($this->con, $dn,array('userpassword' => $hash))){ - msg('LDAP mod replace failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con))); + $this->_debug('LDAP mod replace failed: '. htmlspecialchars($dn) .': '.htmlspecialchars(ldap_error($this->con)), 0, __LINE__, __FILE__); return false; } -- cgit v1.2.3