Code

Renamed acl_get_bases to get_allowed_bases.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Sep 2006 06:15:38 +0000 (06:15 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Sep 2006 06:15:38 +0000 (06:15 +0000)
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

include/class_plugin.inc
plugins/admin/applications/class_applicationGeneric.inc
plugins/admin/departments/class_departmentGeneric.inc
plugins/admin/groups/class_groupGeneric.inc
plugins/admin/mimetypes/class_mimetypeGeneric.inc
plugins/admin/mimetypes/generic.tpl
plugins/admin/ogroups/class_ogroup.inc
plugins/admin/systems/class_printGeneric.inc
plugins/admin/systems/class_workstationGeneric.inc
plugins/personal/generic/class_user.inc

index 04f89717e90812cfc716605cd912f1ab783f8ca2..515c30d12a6ba40186dc4bd99d3a18bbd1d518a7 100644 (file)
@@ -1467,11 +1467,11 @@ echo "FIXME: remove_snapshot uses old acl's<br>";
 
   /* 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<br>";
       echo "No default base found. ".$this->base."<br> ";
     }
 
+    $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;
index 53ace4e8c2ac8077a6b204e7ae807df4cae26660..7cbc9280dc1fff0916953a3a72246c13ddf45bdb 100644 (file)
@@ -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);
       }
     }
index a29b3edc428c0e57137064cd3290e5c38b0b2634..3b6daee52d8093460ba9b38e69918c1bd64a7a11 100644 (file)
@@ -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{
index ef5341b243f322cc00803d30007f1eb191ec58e8..3f87a2a171c8efcf61131b01e7b2a466a7212117 100644 (file)
@@ -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){
index 37d45ca794e07734f7743737838f3ae7dab85edb..08146ee9ecd6dbbaef47bc91bc17e05804edfa12 100644 (file)
@@ -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());
index e913e977b7f85c92c8f384673ef1dc1e6bf918d6..50a83fa6cf8557db6a3ad106e548a4616adbd1f0 100644 (file)
                {html_options options=$bases selected=$base_select}
        </select>
 {/render}
-
+{if !$isReleaseMimeType}
 {render acl=$baseACL disable_picture='images/folder_gray.png'}
         <input type="image" name="chooseBase" src="images/folder.png" class="center" title="{t}Select a base{/t}">
 {/render}
+{/if}
                                        </td>
                                 </tr>
 
index f619d71f9a6f3db95db91b4bc7a1ca9045fd8e47..f2a186c12054b8b307e0237a2142b969cd7a358b 100644 (file)
@@ -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));
index 43634baf83317e80b930c12cc02eea9b079976b9..44fc8330dfdd74825da5ed5cf95439e64bebbfd6 100644 (file)
@@ -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 */
index 8f31136e57af7a2f3df259f720bd41cfb15c223d..b61573302a721d87d37dca48e8418335b18429c1 100644 (file)
@@ -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();
index 117b015d90c736c294ce0aa9afe73525443a9ece..e37f606770e1db45fda51e5f97106e51d6245e00 100644 (file)
@@ -1230,7 +1230,7 @@ class user extends plugin
   function allowedBasesToMoveTo()
   {
     /* Get bases */
-    $bases  = $this->acl_get_bases();
+    $bases  = $this->get_allowed_bases();
     return($bases);
   }