From: hickert Date: Tue, 19 Sep 2006 06:15:38 +0000 (+0000) Subject: Renamed acl_get_bases to get_allowed_bases. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7d291e06679edeea7e0763cd8127e66c10c30072;p=gosa.git Renamed acl_get_bases to get_allowed_bases. Updated get_allowed_bases to use get_module_departments. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4719 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/include/class_plugin.inc b/include/class_plugin.inc index 04f89717e..515c30d12 100644 --- a/include/class_plugin.inc +++ b/include/class_plugin.inc @@ -1467,11 +1467,11 @@ echo "FIXME: remove_snapshot uses old acl's
"; /* Get all allowed bases to move an object to or to create a new object. Idepartments also contains all base departments which lead to the allowed bases */ - function acl_get_bases($category = "") + function get_allowed_bases($category = "") { $ui = get_userinfo(); $deps = array(); - + /* Set category */ if(empty($category)){ $category = $this->acl_category.get_class($this); @@ -1491,7 +1491,13 @@ echo "FIXME: remove_snapshot uses old acl's
"; echo "No default base found. ".$this->base."
"; } + $cat_bases = $ui->get_module_departments(preg_replace("/\/.*$/","",$category)); foreach($this->config->idepartments as $dn => $name){ + + if(!in_array_ics($dn,$cat_bases)){ + continue; + } + $acl = $ui->get_permissions($dn,$category); if($new && preg_match("/c/",$acl)){ $deps[$dn] = $name; diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 53ace4e8c..7cbc9280d 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -159,7 +159,7 @@ class application extends plugin /* Fill templating stuff */ $smarty->assign("cn", $this->cn); - $smarty->assign("bases", $this->acl_get_bases()); + $smarty->assign("bases", $this->get_allowed_bases()); if ($this->dn == "new"){ $smarty->assign("selectmode", ""); $smarty->assign("namemode", ""); @@ -173,7 +173,7 @@ class application extends plugin foreach($_POST as $name => $value){ if(preg_match("/^chooseBase/",$name) && $once){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases()); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); $this->dialog->setCurrentBase($this->base); } } diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index a29b3edc4..3b6daee52 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -106,7 +106,7 @@ class department extends plugin foreach($_POST as $name => $value){ if((preg_match("/^chooseBase/",$name) && $once) && ($this->acl_is_moveable())){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases()); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); $this->dialog->setCurrentBase($this->base); } } @@ -127,7 +127,7 @@ class department extends plugin } /* Hide all departments, that are subtrees of this department */ - $bases = $this->acl_get_bases(); + $bases = $this->get_allowed_bases(); if(($this->dn == "new")||($this->dn == "")){ $tmp = $bases; }else{ diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index ef5341b24..3f87a2a17 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -211,7 +211,7 @@ class group extends plugin if((preg_match("/^chooseBase/",$name) && $once) && ($this->acl_is_moveable())){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases()); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); $this->dialog->setCurrentBase($this->base); } } @@ -293,7 +293,7 @@ class group extends plugin $smarty->assign("launchimage", get_template_path('images/small_filter.png')); $smarty->assign("tree_image", get_template_path('images/tree.png')); - $smarty->assign("deplist", $this->acl_get_bases("users/user")); + $smarty->assign("deplist", $this->get_allowed_bases("users/user")); $smarty->assign("alphabet", generate_alphabet()); foreach( array("dselect", "regex","SubSearchGroup") as $type){ $smarty->assign("$type", $gufilter[$type]); @@ -310,7 +310,7 @@ class group extends plugin $this->base= $_POST['base']; } - $smarty->assign("bases", $this->acl_get_bases()); + $smarty->assign("bases", $this->get_allowed_bases()); $smarty->assign("base_select", $this->base); if ($this->samba3){ diff --git a/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/plugins/admin/mimetypes/class_mimetypeGeneric.inc index 37d45ca79..08146ee9e 100644 --- a/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -165,7 +165,7 @@ class mimetype extends plugin foreach($_POST as $name => $value){ if(preg_match("/^chooseBase/",$name) && $once){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases()); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); echo $this->base; $this->dialog->setCurrentBase($this->base); } @@ -313,7 +313,7 @@ class mimetype extends plugin $fields = array($field1,$field2); $DivEApps -> AddEntry($fields); } - $smarty->assign("bases", $this->acl_get_bases()); + $smarty->assign("bases", $this->get_allowed_bases()); $smarty->assign("base_select", $this->base); $smarty->assign("isReleaseMimeType", $this->isReleaseMimeType); $smarty->assign("gotoMimeFilePatterns", $DivPatterns->DrawList()); diff --git a/plugins/admin/mimetypes/generic.tpl b/plugins/admin/mimetypes/generic.tpl index e913e977b..50a83fa6c 100644 --- a/plugins/admin/mimetypes/generic.tpl +++ b/plugins/admin/mimetypes/generic.tpl @@ -49,10 +49,11 @@ {html_options options=$bases selected=$base_select} {/render} - +{if !$isReleaseMimeType} {render acl=$baseACL disable_picture='images/folder_gray.png'} {/render} +{/if} diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index f619d71f9..f2a186c12 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -187,7 +187,7 @@ class ogroup extends plugin foreach($_POST as $name => $value){ if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_moveable()){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases()); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); $this->dialog->setCurrentBase($this->base); } } @@ -306,7 +306,7 @@ class ogroup extends plugin } /* Assign variables */ - $smarty->assign("bases", $this->acl_get_bases()); + $smarty->assign("bases", $this->get_allowed_bases()); $smarty->assign("base_select", $this->base); $smarty->assign("department", $this->department); $smarty->assign("members", $this->convert_list($this->memberList)); diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 43634baf8..44fc8330d 100644 --- a/plugins/admin/systems/class_printGeneric.inc +++ b/plugins/admin/systems/class_printGeneric.inc @@ -336,7 +336,7 @@ class printgeneric extends plugin foreach($_POST as $name => $value){ if(preg_match("/^chooseBase/",$name) && $once){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases()); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); $this->dialog->setCurrentBase($this->base); $this->baseSelection = true; } @@ -362,7 +362,7 @@ class printgeneric extends plugin } /* Fill templating stuff */ - $smarty->assign("bases", $this->acl_get_bases()); + $smarty->assign("bases", $this->get_allowed_bases()); $smarty->assign("base_select", $this->base); /* Assign attributes */ diff --git a/plugins/admin/systems/class_workstationGeneric.inc b/plugins/admin/systems/class_workstationGeneric.inc index 8f31136e5..b61573302 100644 --- a/plugins/admin/systems/class_workstationGeneric.inc +++ b/plugins/admin/systems/class_workstationGeneric.inc @@ -194,7 +194,7 @@ class workgeneric extends plugin foreach($_POST as $name => $value){ if(preg_match("/^chooseBase/",$name) && $once && $this->acl_is_writeable("base")){ $once = false; - $this->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases()); + $this->dialog = new baseSelectDialog($this->config,$this,$this->get_allowed_bases()); $this->dialog->setCurrentBase($this->base); } } @@ -244,7 +244,7 @@ class workgeneric extends plugin $smarty->assign("cn", $this->cn); $smarty->assign("l", $this->l); - $smarty->assign("bases", $this->acl_get_bases()); + $smarty->assign("bases", $this->get_allowed_bases()); $smarty->assign("staticAddress", ""); $tmp = array(); diff --git a/plugins/personal/generic/class_user.inc b/plugins/personal/generic/class_user.inc index 117b015d9..e37f60677 100644 --- a/plugins/personal/generic/class_user.inc +++ b/plugins/personal/generic/class_user.inc @@ -1230,7 +1230,7 @@ class user extends plugin function allowedBasesToMoveTo() { /* Get bases */ - $bases = $this->acl_get_bases(); + $bases = $this->get_allowed_bases(); return($bases); }