@@ 19-20 (lines=2) @@ | ||
16 | // specify the LDAP server to connect to |
|
17 | $conn = ldap_connect($this->config->item('ldapserver')) or die("Oh no can't create LDAP connection"); |
|
18 | // bind to the LDAP server specified above |
|
19 | if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass'))) |
|
20 | echo "Invalid credentials."; |
|
21 | // Search for user in directory |
|
22 | $cred = explode('\\', $username); |
|
23 | list($domain, $user) = $cred; |
@@ 20-21 (lines=2) @@ | ||
17 | // specify the LDAP server to connect to |
|
18 | $conn = ldap_connect($this->config->item('ldapserver')) or die("Oh no can't create LDAP connection"); |
|
19 | // bind to the LDAP server specified above |
|
20 | if (!ldap_bind($conn, $this->config->item('ldapbindun'),"@".$this->config->item('ldapdomain'), $this->config->item('ldapbindpass'))) |
|
21 | echo "Invalid credentials."; |
|
22 | // Search for user in directory |
|
23 | $cred = explode('\\', $username); |
|
24 | list($domain, $user) = $cred; |