diff --git a/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc b/gosa-plugins/gofon/gofon/macro/class_gofonMacro.inc
index 8a9358a5cdd24e94b7c7881a085d7e846a9230d7..640665faf7fb983a6fbf523228bd8d02196223bf 100644 (file)
var $attributes = array("cn","base", "description","displayName","goFonMacroContent","goFonMacroVisible");
var $view_logged = FALSE;
var $orig_cn = "";
+ var $orig_base = "";
+ var $orig_dn = "";
/*! Objectclasses that this calls handles */
var $objectclasses = array("top", "goFonMacro");
}
} else {
$this->orig_cn=$this->cn;
- $this->base= preg_replace ("/^[^,]+,[^,]+,[^,]+,[^,]+,[^,]+,/", "", $this->dn);
+ $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_ou("macroou"))."/i", "", $this->dn);
}
/* Check server configurations
unset($this->goFonHomeServers[0]);
}
}
+
+ $this->orig_base = $this->base;
+ $this->orig_dn = $this->dn;
}
/* Check if display name is set */
if(empty($this->displayName)){
- $message[] = msgPool::requried(_("Name"));
+ $message[] = msgPool::required(_("Name"));
}
/* CN is restricted to 20 chars */
if(strlen("Makro-".$this->cn)>20 ){
if(empty($this->goFonMacroContent)){
$message[] = _("Macro is empty!");
}
+
+ /* 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;
}