Commit ed8fa328e6527c16f9d4b985953584edd67d780b
1 parent
e6d170e2
don't bind anonymously when connecting to active directory
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1712 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
9 additions
and
4 deletions
lib/authentication/class.AuthLdap.php
| ... | ... | @@ -64,11 +64,16 @@ class AuthLdap { |
| 64 | 64 | foreach ($this->server as $key => $host) { |
| 65 | 65 | $this->connection = ldap_connect( $host); |
| 66 | 66 | if ( $this->connection) { |
| 67 | - // Connected, now try binding.... | |
| 68 | - if ( $this->result=@ldap_bind( $this->connection)) { | |
| 69 | - // Bound OK! | |
| 70 | - $this->bound = $host; | |
| 67 | + // don't try anon bind for ad | |
| 68 | + if ($this->serverType == "ActiveDirectory") { | |
| 71 | 69 | return true; |
| 70 | + } else { | |
| 71 | + // Connected, now try binding.... | |
| 72 | + if ( $this->result=@ldap_bind( $this->connection)) { | |
| 73 | + // Bound OK! | |
| 74 | + $this->bound = $host; | |
| 75 | + return true; | |
| 76 | + } | |
| 72 | 77 | } |
| 73 | 78 | } |
| 74 | 79 | } | ... | ... |