From: hickert Date: Thu, 6 Nov 2008 10:23:05 +0000 (+0000) Subject: Updated ACL handling for new objects. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=ca490c61135165c720744404b5fffe7df63cb8ee;p=gosa.git Updated ACL handling for new objects. -The wrong base used used to check ACLs, this caused problem if user filter settings were used. git-svn-id: https://oss.gonicus.de/repositories/gosa/branches/2.6-lhm@12932 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 79e6b57fd..9d88ec161 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationGeneric.inc @@ -62,6 +62,7 @@ class application extends plugin $this->orig_cn = $this->cn; $this->orig_base = $this->base; + $this->gosaApplicationFlags = preg_replace("/[^GDLMO]/","",$this->gosaApplicationFlags); } @@ -316,10 +317,10 @@ class application extends plugin foreach($checks as $name => $flag){ if($this->acl_is_writeable($name)){ $set = isset($_POST[$name]) && $_POST[$name] == 1; - if(!$set && preg_match("/".$flag."/",$this->gosaApplicationFlags)){ - $this->gosaApplicationFlags = preg_replace("/".$flag."/","",$this->gosaApplicationFlags); + if(!$set && strstr($this->gosaApplicationFlags,$flag)){ + $this->gosaApplicationFlags = str_replace($flag,"",$this->gosaApplicationFlags); }elseif($set && !preg_match("/".$flag."/",$this->gosaApplicationFlags)){ - $this->gosaApplicationFlags = preg_replace("/]/",$flag."]",$this->gosaApplicationFlags); + $this->gosaApplicationFlags .= $flag; } } } @@ -474,6 +475,7 @@ class application extends plugin /* Get application script without header part, to check if we must save the script itself */ $script = preg_replace('/.*### END HEADER ###/s', '', $this->gotoLogonScript); + $this->gosaApplicationFlags ="[{$this->gosaApplicationFlags}]"; plugin::save(); $this->attrs["gosaApplicationIcon"]= $this->gosaApplicationIcon; diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc index bf332fed6..d4d18b060 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc @@ -34,6 +34,7 @@ class applicationManagement extends plugin var $enableReleaseManagement = false; var $start_pasting_copied_objects = FALSE; + var $acl_base =""; var $app_base =""; var $app_release =""; var $acl_module = array("application"); @@ -56,6 +57,7 @@ class applicationManagement extends plugin /* Save configuration for internal use */ $this->config = &$config; $this->ui = &$ui; + $this->acl_base = $this->config->current['BASE']; /* Check if copy & paste is activated */ if($this->config->boolValueIsTrue("MAIN","COPYPASTE")){ @@ -231,7 +233,13 @@ class applicationManagement extends plugin /* Create new usertab object */ $this->apptabs= new apptabs($this->config,$this->config->data['TABS']['APPSTABS'], $this->dn,"application"); $this->apptabs->parent = &$this; - $this->apptabs->set_acl_base($this->app_base); + + /* Check if there is a snapshot dialog open */ + if($this->IsReleaseManagementActivated()){ + $this->apptabs->set_acl_base($this->acl_base); + }else{ + $this->apptabs->set_acl_base($this->DivListApplication->selectedBase); + } } diff --git a/gosa-plugins/goto/admin/applications/class_divListApplication.inc b/gosa-plugins/goto/admin/applications/class_divListApplication.inc index 2d7a31ab4..18a79c93e 100644 --- a/gosa-plugins/goto/admin/applications/class_divListApplication.inc +++ b/gosa-plugins/goto/admin/applications/class_divListApplication.inc @@ -94,16 +94,22 @@ class divListApplication extends MultiSelectWindow /* Get acls */ $ui = get_userinfo(); - $acl = $ui->get_permissions($this->selectedBase,"application/application"); - $acl_all = $ui->has_complete_category_acls($this->parent->app_base,"application"); + + if($this->parent->IsReleaseManagementActivated()){ + $acl = $ui->get_permissions($this->parent->acl_base,"application/application"); + $acl_all = $ui->has_complete_category_acls($this->parent->acl_base,"application"); + }else{ + $acl = $ui->get_permissions($this->selectedBase,"application/application"); + $acl_all = $ui->has_complete_category_acls($this->parent->app_base,"application"); + } /* Create Layers menu */ $s = ".|"._("Actions")."|\n"; /* Append create options */ + $s .= "..|". + " "._("Create")."|\n"; if(preg_match("/c/",$acl)) { - $s .= "..|". - " "._("Create")."|\n"; $s.= "...|". " "._("Application")."|appl_new|\n"; }