diff --git a/htdocs/lib/ldap.class.php b/htdocs/lib/ldap.class.php index 7c5c38fc0a4..4d3b82e208e 100644 --- a/htdocs/lib/ldap.class.php +++ b/htdocs/lib/ldap.class.php @@ -436,9 +436,11 @@ class Ldap ** "uid=username, ou=People, dc=orgname,dc=com" */ if ($this->serverType == "activedirectory") { - $checkDn = "$uname@$this->domain"; + $domain = eregi_replace('dc=','',$this->domain); + $domain = eregi_replace(',','.',$domain); + $checkDn = "$uname@$domain"; } else { - $checkDn = $this->getUserIdentifier() . "=$uname, " . $this->setDn(true); + $checkDn = $this->getUserIdentifier() . "=$uname, " . $this->setDn(true); } // Try and connect... $this->result = @ldap_bind( $this->connection,$checkDn,$pass);