From ed8fa328e6527c16f9d4b985953584edd67d780b Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 11 Apr 2003 09:01:06 +0000 Subject: [PATCH] don't bind anonymously when connecting to active directory --- lib/authentication/class.AuthLdap.php | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/authentication/class.AuthLdap.php b/lib/authentication/class.AuthLdap.php index 979443d..be5429d 100644 --- a/lib/authentication/class.AuthLdap.php +++ b/lib/authentication/class.AuthLdap.php @@ -64,11 +64,16 @@ class AuthLdap { foreach ($this->server as $key => $host) { $this->connection = ldap_connect( $host); if ( $this->connection) { - // Connected, now try binding.... - if ( $this->result=@ldap_bind( $this->connection)) { - // Bound OK! - $this->bound = $host; + // don't try anon bind for ad + if ($this->serverType == "ActiveDirectory") { return true; + } else { + // Connected, now try binding.... + if ( $this->result=@ldap_bind( $this->connection)) { + // Bound OK! + $this->bound = $host; + return true; + } } } } -- libgit2 0.21.4