I am attempting to setup a linux moodle server on our site using ldap authentication on a Windows 2003 Active Directory server. After finding that ldap_user_attribute did not default to cn, everything worked. I then changed this to sAMAccountName, set the ldap_memberattribute to memberOf and tried to prepopulate the user fields with ldap attributes i.e. sn and GivenName. Since the I get an error when a user logs in
Notice: Undefined index CN in /var/www/html/moodle/auth/ldap/lib.php on line 574
Warning Cannot add header information - headers already sent by (output started at /var... 574) in /var/www/html/moodle/lib/moodlelib.php on line 947
As far as I can see the offending line is array_push in
//add found users to list
for ($i=0;$i<$users['count'];$i++) {
array_push($fresult, ($users[$i][$CFG->ldap_user_attribute][0]) );
}
Can someone give me a clue as to what may be happening?