index 0f108c4d22789e88a3ebfb43b9a37098443411bc..e854884a4e81f9c3c10b265f647f660e6617f75c 100644 (file)
$this->config= &$config;
$this->dn= $dn;
+ // Ensure that we've a valid acl_category set.
+ if(empty($this->acl_category)){
+ $tmp = $this->plInfo();
+ if (isset($tmp['plCategory'])) {
+ $c = key($tmp['plCategory']);
+ if(is_numeric($c)){
+ $c = $tmp['plCategory'][0];
+ }
+ $this->acl_category = $c."/";
+ }
+ }
+
/* Handle new accounts, don't read information from LDAP */
if ($dn == "new"){
return;
$role->save();
}
}
+
+ // Update 'manager' attributes from gosaDepartment and inetOrgPerson
+ $filter = "(&(objectClass=inetOrgPerson)(manager=".LDAP::prepare4filter(LDAP::fix($src_dn))."))";
+ $ocs = $ldap->get_objectclasses();
+ if(isset($ocs['gosaDepartment']['MAY']) && in_array('manager', $ocs['inetOrgPerson']['MAY'])){
+ $filter = "(|".$filter."(&(objectClass=gosaDepartment)(manager=".LDAP::prepare4filter(LDAP::fix($src_dn)).")))";
+ }
+ $leaf_deps= get_list($filter,array("all"),$this->config->current['BASE'],
+ array("manager","dn","objectClass"),GL_SUBSEARCH | GL_NO_ACL_CHECK);
+ foreach($leaf_deps as $entry){
+ $update = array('manager' => $dst_dn);
+ $ldap->cd($entry['dn']);
+ $ldap->modify($update);
+ if(!$ldap->success()){
+ trigger_error(sprintf("Failed to update manager for '%s', error was '%s'", $entry['dn'], $ldap->get_error()));
+ }
+ }
/* Check if there are gosa departments moved.
If there were deps moved, the force reload of config->deps.
}
}
- function tag_attrs(&$at, $dn= "", $tag= "", $show= false)
- {
- /* Skip tagging?
- /*! \brief Get gosaUnitTag for the given DN */
+ /*! \brief Get gosaUnitTag for the given DN
If this is called from departmentGeneric, we have to skip this
tagging procedure.
- */
+ */
+ function tag_attrs(&$at, $dn= "", $tag= "", $show= false)
+ {
+ /* Skip tagging? */
if($this->skipTagging){
return;
}