From: hickert Date: Wed, 28 May 2008 08:56:04 +0000 (+0000) Subject: Added move / create check X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f41cbcda21faef11df546fd367e44d8486674bb0;p=gosa.git Added move / create check git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11064 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc index 97da83a3c..d8531b42a 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc @@ -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; }