diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc
index 5815a4a90ed5cfec54b70cf46eed28ea658a658a..002b38b2eb4c3fe12d580b6c3e15e2b56c079d73 100644 (file)
var $cn= "";
var $description= "";
var $orig_dn= "";
+ var $orig_cn= "";
+ var $orig_base= "";
/* attribute list for save action */
var $attributes= array("cn", "description");
$this->base= dn2base($ui->dn);
$this->cn= "";
} else {
- $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("componentou"))."/", "", $this->dn);
}
$this->netConfigDNS = new termDNS($this->config,$this,$this->objectclasses, true);
/* Save dn for later references */
$this->orig_dn= $this->dn;
+
+ $this->orig_base = $this->base;
+ $this->orig_cn = $this->cn;
}
/* Do we represent a valid phone? */
if (!$this->is_account && $this->parent === NULL){
- $display= "<img alt=\"\" src=\"images/stop.png\" align=middle> <b>".
- _("This 'dn' has no network features.")."</b>";
+ $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle> <b>".
+ msgPool::noValidExtension(_("component"))."</b>";
return($display);
}
new log("remove","component/".get_class($this),$this->dn,$this->attributes,$ldap->get_error());
- show_ldap_error($ldap->get_error(), sprintf(_("Removing of system component/generic with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, LDAP_DEL, get_class()));
+ }
+
$this->handle_post_events(array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
/* Delete references to object groups */
}
}
+ /* Check if we are allowed to create or move this object
+ */
+ if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
+ $message[] = msgPool::permCreate();
+ }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
+ $message[] = msgPool::permMove();
+ }
+
return ($message);
}
$this->handle_post_events("add",array("macAddress" => $this->netConfigDNS->macAddress,"ipHostNumber" => $this->netConfigDNS->ipHostNumber));
} else {
- if ($this->orig_dn != $this->dn){
- $this->move($this->orig_dn, $this->dn);
- }
-
$ldap->cd($this->dn);
$this->cleanup();
$ldap->modify ($this->attrs);
$this->netConfigDNS->cn = $this->cn;
$this->netConfigDNS->save();
- show_ldap_error($ldap->get_error(), sprintf(_("Saving of system component/generic with dn '%s' failed."),$this->dn));
+ if (!$ldap->success()){
+ msg_dialog::display(_("LDAP error"), msgPool::ldaperror($ldap->get_error(), $this->dn, 0, get_class()));
+ }
}
/* Return plugin informations for acl handling */