diff --git a/gosa-plugins/systems/admin/systems/class_componentGeneric.inc b/gosa-plugins/systems/admin/systems/class_componentGeneric.inc
index bfec11c8204bf49ab6b7541a582082d49d96ddf8..b3ff77e38c4df28568bca1ea8d2d5cb9496def74 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 ("/^[^,]+,".normalizePreg(get_ou("componentou"))."/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".preg_quote(get_ou("componentRDN"), '/')."/i", "", $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>".
+ $display= "<img alt=\"\" src=\"images/small-error.png\" align=middle> <b>".
msgPool::noValidExtension(_("component"))."</b>";
return($display);
}
$message= plugin::check();
$message= array_merge($message,$this->netConfigDNS->check());
- $this->dn= "cn=".$this->cn.",".get_ou('componentou').$this->base;
+ $this->dn= "cn=".$this->cn.",".get_ou('componentRDN').$this->base;
if ($this->cn == "" ){
$message[]= msgPool::required(_("Component name"));
if(preg_match("/cn=dhcp,/",$attrs['dn'])){
continue;
}
- if ($attrs['dn'] != $this->orig_dn){
+ if ($attrs['dn'] != $this->orig_dn && preg_match("/".preg_quote(get_ou("componentRDN"), '/')."/i",$attrs['dn'])){
$message[]= msgPool::duplicated(_("Component name"));
break;
}
}
}
+ /* 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);
"plProvidedAcls"=> array(
"cn" => _("Name"),
"base" => _("Base"),
- "description" => _("Description"))
+ "description" => _("Description"),
+ "userPassword" => _("Root password"))
));
}
$this->netConfigDNS->ipHostNumber = $source['ipHostNumber'][0];
}
}
+
+
+ function is_modal_dialog()
+ {
+ return((isset($this->dialog) && $this->dialog) || (isset($this->netConfigDNS->dialog) && $this->netConfigDNS->dialog));
+ }
+
}
// vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler: