index 5497098cc47842655f61756dedc279566ea0ae98..42f7e5feaee73d2b42ac2e63cff8272663de6e9d 100644 (file)
if(($this->SubObjects[$key]['status'] == "new") || ($this->SubObjects[$key]['dn'] == "new")){
$down = "";
}else{
- $down = "<a href='getFAIscript.php?id=".base64_encode($name['dn'])."' target='_blank'>
+ $down = "<a href='getFAIscript.php?id=".base64_encode($name['dn'])."'>
<img src='images/save.png' alt='"._("Download")."' title='"._("Download")."' border=0>
</a>";
}
$ldap = $this->config->get_ldap_link();
$ldap->cd ($this->dn);
$ldap->rmdir_recursive($this->dn);
+ show_ldap_error($ldap->get_error(), _("Removing FAI hook base failed"));
$this->handle_post_events("remove");
}
$ldap = $this->config->get_ldap_link();
- $ldap->cat($this->dn);
+ $ldap->cat($this->dn,array("objectClass"));
if($ldap->count()!=0){
/* Write FAIscript to ldap*/
$ldap->cd($this->dn);
$ldap->cd($this->dn);
$ldap->add($this->attrs);
}
- show_ldap_error($ldap->get_error());
+ show_ldap_error($ldap->get_error(), _("Saving FAI hook base failed"));
/* Do object tagging */
$this->handle_object_tagging();
- show_ldap_error($ldap->get_error());
$ldap->cd($this->dn);
}
}
-
+ $tmp['objectClass'] = $this->subClasses;
+
$sub_dn = "cn=".$obj['cn'].",".$this->dn;
- plugin::plugin($this->config,$sub_dn);
- $tmp['objectClass'] = $this->attrs['objectClass'];
- foreach($this->subClasses as $class){
- if(!in_array($class,$tmp['objectClass'])){
- $tmp['objectClass'][] = $class;
+ if($obj['status']=="new"){
+ $ldap->cat($sub_dn,array("objectClass"));
+ if($ldap->count()){
+ $obj['status']="edited";
}
}
- if($obj['status']=="new"){
- $ldap->cat($sub_dn);
- if($ldap->count()){
- $obj['status']="modify";
+ /* Check if gosaAdministrativeUnitTag is required as object class */
+ if($obj['status'] == "edited"){
+ $ldap->cat($sub_dn,array("objectClass"));
+ $attrs = $ldap->fetch();
+ if(isset($attrs['objectClass'])){
+ if(in_array_ics("gosaAdministrativeUnitTag",$attrs['objectClass'])){
+ $tmp['objectClass'][] = "gosaAdministrativeUnitTag";
+ }
}
}
$ldap->cd($sub_dn);
$ldap->rmdir_recursive($sub_dn);
$this->handle_post_events("remove");
+ show_ldap_error($ldap->get_error(), _("Removing FAI hook failed"));
}elseif($obj['status'] == "edited"){
$ldap->cd($sub_dn);
$this->cleanup();
$ldap->modify ($tmp);
-
$this->handle_post_events("modify");
+ show_ldap_error($ldap->get_error(), _("Saving FAI hook failed"));
}elseif($obj['status']=="new"){
if($tmp['description']==array()){
unset($tmp['description']);
$ldap->cd($sub_dn);
$ldap->add($tmp);
$this->handle_post_events("add");
+ show_ldap_error($ldap->get_error(), _("Saving FAI hook failed"));
}
$this->handle_object_tagging($sub_dn, $this->gosaUnitTag);
- show_ldap_error($ldap->get_error());
}
}
}