diff --git a/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc b/gosa-plugins/fai/admin/fai/class_faiVariableEntry.inc
index 92ba68d200ccd181d2f7490c5e50946f97febf28..dd88739559bbda247393bf731682347c82ecd506 100644 (file)
$oname = $name;
$this->$oname=addslashes($value);
}
$oname = $name;
$this->$oname=addslashes($value);
}
-
- if(isset($this->attrs['FAIstate'][0])){
- $this->FAIstate = $this->attrs['FAIstate'][0];
- }
-
}else{
$this->status = "new";
$this->orig_cn = false;
}else{
$this->status = "new";
$this->orig_cn = false;
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $name => $translated){
$tmp = $this->plInfo();
foreach($tmp['plProvidedAcls'] as $name => $translated){
- $acl = $this->getacl($name);
- if($this->FAIstate == "freezed"){
- $acl = preg_replace("/w/","",$acl);
- }
+ $acl = $this->getacl($name, preg_match("/freeze/",$this->FAIstate));
$smarty->assign($name."ACL",$acl);
}
$smarty->assign($name."ACL",$acl);
}
-
-
+ $smarty->assign("freeze",preg_match("/freeze/",$this->FAIstate));
$display.= $smarty->fetch(get_template_path('faiVariableEntry.tpl', TRUE));
return($display);
}
$display.= $smarty->fetch(get_template_path('faiVariableEntry.tpl', TRUE));
return($display);
}
+
/* Save data to object */
function save_object()
{
/* Save data to object */
function save_object()
{
- if((isset($_POST['SubObjectFormSubmitted'])) && ($this->FAIstate != "freeze")){
+ if((isset($_POST['SubObjectFormSubmitted'])) && !preg_match("/freeze/", $this->FAIstate)){
foreach($this->attributes as $attrs){
if($this->acl_is_writeable($attrs)){
if(isset($_POST[$attrs])){
foreach($this->attributes as $attrs){
if($this->acl_is_writeable($attrs)){
if(isset($_POST[$attrs])){
$message= plugin::check();
if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){
$message= plugin::check();
if(isset($this->parent->SubObjects[$this->cn]) && $this->cn != $this->orig_cn){
- $message[] = msgPool::duplicate(_("Name"));
+ $message[] = msgPool::duplicated(_("Name"));
}
}
- if(empty($this->FAIvariableContent)) {
+ if($this->FAIvariableContent == "") {
$message[]= msgPool::required(_("Content"));
}
$message[]= msgPool::required(_("Content"));
}
-
- if(empty($this->cn)){
+
+ $c = trim($this->cn);
+ if($c == ""){
$message[] = msgPool::required(_("Name"));
}
$message[] = msgPool::required(_("Name"));
}
+ if(preg_match("/[^a-z0-9_\-]/i",$c)){
+ $message[] = msgPool::invalid(_("Name"),$c,"/[a-z0-9_\-]/i");
+ }
return ($message);
}
return ($message);
}