Code

Updated acl checks
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 09:34:30 +0000 (09:34 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Wed, 28 May 2008 09:34:30 +0000 (09:34 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11067 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-plugins/samba/admin/systems/samba/class_winGeneric.inc

index 19d5cb9337739ab5bcd500fee094e9fe71e6c507..b95909b27be1522beed84162327469de9fb22bb3 100644 (file)
@@ -30,6 +30,10 @@ class wingeneric extends plugin
   var $sambaPwdLastSet="";
   var $sambaAcctFlags="";
   var $netConfigDNS;
+
+  var $orig_cn;
+  var $orig_base;
+
   /* attribute list for save action */
   var $ignore_account= TRUE;
   var $attributes   = array("cn", "description","shadowLastChange",
@@ -54,10 +58,12 @@ class wingeneric extends plugin
       $this->base= preg_replace ("/^[^,]+,".normalizePreg(get_winstations_ou())."/", "", $this->dn);
     }
 
+    $this->cn= preg_replace("/\\\$\$/","",$this->cn);
+
     /* Save dn for later references */
     $this->orig_dn= $this->dn;
-
-    $this->cn= preg_replace("/\\\$\$/","",$this->cn);
+    $this->orig_base= $this->base;
+    $this->orig_cn= $this->cn;
   }
 
 
@@ -221,6 +227,14 @@ class wingeneric 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->base != $this->orig_base && !$this->acl_is_moveable($this->base)){
+      $message[] = msgPool::permMove();
+    }
+
     return ($message);
   }