Code

Applied commits from 13003.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 May 2009 11:58:27 +0000 (11:58 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 6 May 2009 11:58:27 +0000 (11:58 +0000)
-Added special check when copying applications.

git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@13613 594d385d-05f5-0310-b6e9-bd551577e9d8

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

index b6caa4d92e41ee5becc1d495299430004d078fb3..a62c9c576b7082120acd881d477d8dd6e2c849ba 100644 (file)
@@ -17,6 +17,8 @@ class application extends plugin
   var $last_sorting= "invalid";
   var $applications= array();
 
+  var $copy_source_dn ="";
+
   var $orig_base = "";
   var $orig_cn = "";
   var $orig_dn = "";
@@ -460,12 +462,19 @@ class application extends plugin
 
     /* 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();
+    if($this->copy_source_dn != ""){
+      if(!$this->acl_is_createable($this->copy_source_dn)){
+        $message[] = msgPool::permCreate();
+      }
+    }else{
+      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;
   }
 
@@ -586,6 +595,7 @@ class application extends plugin
     plugin::PrepareForCopyPaste($source);
     $source_o = new application($this->config,$source['dn']);
     $this->gosaApplicationIcon = $source_o->gosaApplicationIcon;     
+    $this->copy_source_dn = $source['dn'];
   }