prise en compte attribut member pour AD
This commit is contained in:
parent
d1a3187cba
commit
ef0ba6ef25
|
@ -79,6 +79,7 @@ class SynchroCommand extends Command
|
|||
$ldap_member = strtolower($this->container->getParameter('ldap_member'));
|
||||
$scribe_group = strtolower($this->container->getParameter('scribe_group'));
|
||||
|
||||
$ldap_type = $this->container->getParameter('ldap_type');
|
||||
$ldap_template = $this->container->getParameter('ldap_template');
|
||||
$ldap_usersadmin = $this->container->getParameter('ldap_usersadmin');
|
||||
$scribe_master = strtolower($this->container->getParameter('scribe_master'));
|
||||
|
@ -633,10 +634,13 @@ class SynchroCommand extends Command
|
|||
$dn=$this->ldap->getNiveau01DN($data->getLabel());
|
||||
$attrs["memberuid"]=array();
|
||||
$attrs["cadolesMember"]=array();
|
||||
if($ldap_type=="AD") $attrs["member"]=array();
|
||||
|
||||
foreach($data->getUsers() as $userniveau01) {
|
||||
array_push($attrs["memberuid"],$userniveau01->getUsername());
|
||||
array_push($attrs["cadolesMember"],$this->ldap->getUserDN($userniveau01));
|
||||
if($ldap_type=="AD") array_push($attrs["member"],$this->ldap->getUserDN($userniveau01));
|
||||
|
||||
$this->writeln(' > '.$userniveau01->getUsername());
|
||||
}
|
||||
if(!$simulate) $this->ldap->ldapModify($dn, $attrs);
|
||||
|
@ -664,10 +668,13 @@ class SynchroCommand extends Command
|
|||
$dn=$this->ldap->getNiveau02DN($data->getLabel());
|
||||
$attrs["memberuid"]=array();
|
||||
$attrs["cadolesMember"]=array();
|
||||
if($ldap_type=="AD") $attrs["member"]=array();
|
||||
|
||||
foreach($data->getUsers() as $userniveau01) {
|
||||
array_push($attrs["memberuid"],$userniveau01->getUsername());
|
||||
array_push($attrs["cadolesMember"],$this->ldap->getUserDN($userniveau01));
|
||||
if($ldap_type=="AD") array_push($attrs["member"],$this->ldap->getUserDN($userniveau01));
|
||||
|
||||
$this->writeln(' > '.$userniveau01->getUsername());
|
||||
}
|
||||
if(!$simulate) $this->ldap->ldapModify($dn, $attrs);
|
||||
|
@ -696,11 +703,14 @@ class SynchroCommand extends Command
|
|||
$dn=$this->ldap->getGroupDN($data->getLabel());
|
||||
$attrs["memberuid"]=array();
|
||||
$attrs["cadolesMember"]=array();
|
||||
if($ldap_type=="AD") $attrs['member']=array();
|
||||
|
||||
foreach($data->getUsers() as $usergroupe) {
|
||||
if(!in_array($usergroupe->getUser()->getUsername(), $attrs["memberuid"])) {
|
||||
array_push($attrs["memberuid"],$usergroupe->getUser()->getUsername());
|
||||
array_push($attrs["cadolesMember"],$this->ldap->getUserDN($usergroupe->getUser()));
|
||||
if($ldap_type=="AD") array_push($attrs["member"],$this->ldap->getUserDN($usergroupe->getUser()));
|
||||
|
||||
$this->writeln(' > '.$usergroupe->getUser()->getUsername());
|
||||
}
|
||||
else {
|
||||
|
|
|
@ -241,6 +241,7 @@ class ldapService
|
|||
$dn = $this->getNiveau01DN($result["cn"]);
|
||||
$entry['memberuid'] = $user->getUsername();
|
||||
$entry['cadolesMember'] = $this->getUserDN($user);
|
||||
if($this->type=="AD") $entry['member'] = $this->getUserDN($user);
|
||||
|
||||
$result = ldap_mod_del($connection, $dn, $entry);
|
||||
if(!$result) $this->ldapError();
|
||||
|
@ -257,6 +258,7 @@ class ldapService
|
|||
$dn = $this->getNiveau01DN($user->getNiveau01()->getLabel());
|
||||
$entry['memberuid'] = $user->getUsername();
|
||||
$entry['cadolesMember'] = $this->getUserDN($user);
|
||||
if($this->type=="AD") $entry['member'] = $this->getUserDN($user);
|
||||
|
||||
$result = ldap_mod_add($connection, $dn, $entry);
|
||||
if(!$result) $this->ldapError();
|
||||
|
@ -273,6 +275,8 @@ class ldapService
|
|||
$dn = $this->getNiveau02DN($result["cn"]);
|
||||
$entry['memberuid'] = $user->getUsername();
|
||||
$entry['cadolesMember'] = $this->getUserDN($user);
|
||||
if($this->type=="AD") $entry['member'] = $this->getUserDN($user);
|
||||
|
||||
$result = ldap_mod_del($connection, $dn, $entry);
|
||||
if(!$result) $this->ldapError();
|
||||
}
|
||||
|
@ -289,6 +293,8 @@ class ldapService
|
|||
$dn = $this->getNiveau02DN($user->getNiveau02()->getLabel());
|
||||
$entry['memberuid'] = $user->getUsername();
|
||||
$entry['cadolesMember'] = $this->getUserDN($user);
|
||||
if($this->type=="AD") $entry['member'] = $this->getUserDN($user);
|
||||
|
||||
$result = ldap_mod_add($connection, $dn, $entry);
|
||||
if(!$result) $this->ldapError();
|
||||
}
|
||||
|
@ -652,6 +658,8 @@ class ldapService
|
|||
$dn = $this->getGroupDN($usergroup->getGroup()->getLabel());
|
||||
$entry['memberuid'] = $usergroup->getUser()->getUsername();
|
||||
$entry['cadolesMember'] = $this->getUserDN($usergroup->getUser());
|
||||
if($this->type=="AD") $entry['member'] = $this->getUserDN($usergroup->getUser());
|
||||
|
||||
$result = ldap_mod_add($connection, $dn, $entry);
|
||||
if(!$result) $this->ldapError();
|
||||
}
|
||||
|
@ -673,6 +681,8 @@ class ldapService
|
|||
$dn = $this->getGroupDN($usergroup->getGroup()->getLabel());
|
||||
$entry['memberuid'] = $usergroup->getUser()->getUsername();
|
||||
$entry['cadolesMember'] = $this->getUserDN($usergroup->getUser());
|
||||
if($this->type=="AD") $entry['member'] = $this->getUserDN($usergroup->getUser());
|
||||
|
||||
$result = ldap_mod_del($connection, $dn, $entry);
|
||||
if(!$result) $this->ldapError();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue