Permalink
Browse files

Use only atrributes marked as "updateremote" when creating new ldap-u…

…sers.
  • Loading branch information...
paca70
paca70 committed Sep 22, 2004
1 parent 0b543a6 commit d43ced93fc614191abaaa32dad9c8876baeb0cf2
Showing with 5 additions and 4 deletions.
  1. +5 −4 auth/ldap/lib.php
View
@@ -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);

0 comments on commit d43ced9

Please sign in to comment.