Code

Added move / create check
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 08:56:04 +0000 (08:56 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 08:56:04 +0000 (08:56 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11064 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/goto/admin/applications/class_applicationGeneric.inc

index 97da83a3cb0b1a173b0226430340216ba9165f5c..d8531b42a00beec8540ab5f5691967779bdac5f2 100644 (file)
@@ -17,6 +17,9 @@ class application extends plugin
   var $last_sorting= "invalid";
   var $applications= array();
 
+  var $orig_base = "";
+  var $orig_cn = "";
+
   /* attribute list for save action */
   var $attributes= array("cn", "description", "gosaApplicationExecute", "gosaApplicationName","gosaApplicationIcon",
       "gosaApplicationFlags","gotoLogonScript");
@@ -53,6 +56,9 @@ class application extends plugin
     } else {
       $this->base= preg_replace ("/^[^,]+,".get_ou('applicationou')."/", "", $this->dn);
     }
+
+    $this->orig_cn = $this->cn;
+    $this->orig_base = $this->base;
   }
 
 
@@ -444,6 +450,15 @@ class application extends plugin
         $message[]= msgPool::duplicated("cn");
       }
     }
+
+    /* Check if we are allowed to create or move this object 
+     */
+    if($this->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)){
+      $message[] = msgPool::permMove();
+    }
+
     return $message;
   }