Skip to content
Snippets Groups Projects
Commit 3b91acad authored by Roger Feese's avatar Roger Feese
Browse files

Merge branch 'ldap-to-ad' into 'master'

Ldap to ad

See merge request !5
parents da75fd97 d8bbe0da
No related branches found
No related tags found
1 merge request!5Ldap to ad
......@@ -9,8 +9,8 @@ class Config
$this->studentDsn = 'mysql://username:password@hostname/database';
$this->verifiedDir = __DIR__ . '/../verified';
$this->filesPath = __DIR__ . '/../import';
$this->ldapHost = 'example.com';
$this->ldapDn = 'uid=nobody,dc=example,dc=com';
$this->ldapHost = 'unl.edu';
$this->ldapDn = 'cn=service-account-name,ou=service,dc=unl,dc=edu';
$this->ldapPassword = 'password';
}
......
......@@ -55,7 +55,7 @@ class User
$r = ldap_bind( $ds, Config::getInstance()->ldapDn, Config::getInstance()->ldapPassword );
if( ! $r ) throw new Exception( 'Could not bind to UNL LDAP server. (' . ldap_errno($ds) . '): ' . ldap_error($ds) );
$filter = 'uid=' . $username;
$filter = 'cn=' . $username;
$sr = ldap_search($ds, 'ou=people,dc=unl,dc=edu', $filter );
if( ! $sr ) throw new Exception( 'Search of UNL LDAP server failed. (' . ldap_errno($ds) . '): ' . ldap_error($ds) );
......@@ -78,7 +78,7 @@ class User
$data = array (
'nuid' => $info[0]['unluncwid'][0],
'user_name' => $info[0]['uid'][0],
'user_name' => $info[0]['cn'][0],
'first_name' => $info[0]['givenname'][0],
'last_name' => $info[0]['sn'][0],
'email' => $info[0]['mail'][0]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment