Code

Updated move and create checks
[gosa.git] / gosa-plugins / goto / admin / applications / class_applicationGeneric.inc
index d8531b42a00beec8540ab5f5691967779bdac5f2..820c9cea070004e6ba4dd85cae8e39ce7e1a2e0e 100644 (file)
@@ -19,6 +19,7 @@ class application extends plugin
 
   var $orig_base = "";
   var $orig_cn = "";
+  var $orig_dn = "";
 
   /* attribute list for save action */
   var $attributes= array("cn", "description", "gosaApplicationExecute", "gosaApplicationName","gosaApplicationIcon",
@@ -32,6 +33,7 @@ class application extends plugin
 
     /* Load icon */
     $ldap= $config->get_ldap_link();
+    $this->orig_dn = $dn;
     if ($dn != 'new'){
       $this->iconData= $ldap->get_attribute($dn, "gosaApplicationIcon");
       $this->saved_attributes['gosaApplicationIcon'] = $this->iconData;
@@ -453,9 +455,9 @@ class application extends plugin
 
     /* Check if we are allowed to create or move this object 
      */
-    if($this->dn == "new" && !$this->acl_is_createable($this->base)){
+    if($this->orig_dn == "new" && !$this->acl_is_createable($this->base)){
       $message[] = msgPool::permCreate();
-    }elseif($this->cn != $this->orig_cn || $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
+    }elseif($this->orig_dn != "new" && $this->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
       $message[] = msgPool::permMove();
     }