Code

Improve commit messages for already existing shares
[gosa.git] / trunk / gosa-plugins / goto / admin / applications / class_applicationGeneric.inc
index b6caa4d92e41ee5becc1d495299430004d078fb3..2e2052ef72c62f86e015054e2fe3deeef4255e0f 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;
   }
 
@@ -478,6 +487,11 @@ class application extends plugin
 
     $this->gosaApplicationFlags ="[{$this->gosaApplicationFlags}]";
     plugin::save();
+
+    /* Handle tagging */
+    $ui= get_userinfo();
+    $this->tag_attrs($this->attrs, $this->dn, $ui->gosaUnitTag);
+
     $this->attrs["gosaApplicationIcon"]= $this->gosaApplicationIcon;
 
     /* Write back to ldap */
@@ -586,6 +600,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'];
   }