From: paca70 Date: Wed, 22 Sep 2004 11:06:42 +0000 (+0000) Subject: Use only atrributes marked as "updateremote" when creating new ldap-users. X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=d43ced93fc614191abaaa32dad9c8876baeb0cf2;p=moodle.git Use only atrributes marked as "updateremote" when creating new ldap-users. --- diff --git a/auth/ldap/lib.php b/auth/ldap/lib.php index daf4a5ad97..a3c5db93ff 100644 --- a/auth/ldap/lib.php +++ b/auth/ldap/lib.php @@ -171,18 +171,19 @@ function auth_user_create ($userobject,$plainpass) { $newuser = array(); foreach ($attrmap as $key=>$value){ - if(isset($userobject->$key) ){ - $newuser[$value]=utf8_encode($userobject->$key); + if(!empty($userobject->$key) ){ + if (isset($CFG->{auth_user_.$key._updateremote}) && $CFG->{auth_user_.$key._updateremote} == "1" ) { + $newuser[$value]=utf8_encode($userobject->$key); + } } } //Following sets all mandatory and other forced attribute values - //this should be moved to config inteface ASAP + //MODIFY following to suite your enviroment $newuser['objectClass']= array("inetOrgPerson","organizationalPerson","person","top"); $newuser['uniqueId']= $userobject->username; $newuser['logindisabled']="TRUE"; $newuser['userpassword']=$plainpass; - unset($newuser[country]); $uadd = ldap_add($ldapconnection, $CFG->ldap_user_attribute."=$userobject->username,".$CFG->ldap_create_context, $newuser);