Code

Fixed base selection dialog.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Sep 2006 04:17:54 +0000 (04:17 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Tue, 19 Sep 2006 04:17:54 +0000 (04:17 +0000)
Added acl_get_bases to printGeneric

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@4716 594d385d-05f5-0310-b6e9-bd551577e9d8

plugins/admin/systems/class_baseSelectDialog.inc
plugins/admin/systems/class_printGeneric.inc

index fe3ccd75585737841d01f53016b7796cffac5d94..0a1040c7a22909d72193cfec8ba8122ab60fb998 100644 (file)
@@ -138,6 +138,9 @@ class baseSelectDialog extends MultiSelectWindow
 
   function save_object()
   {
+    /* Save current base */
+    $old_base = $this->selectedBase;
+  
     /* Save automatic created POSTs like regex, checkboxes */
     MultiSelectWindow::save_object();   
     
@@ -184,6 +187,11 @@ class baseSelectDialog extends MultiSelectWindow
         $this->selectedBase= $this->config->departments["/"];
       }
     }
+
+    /* Restore old base, if selected base is not allowed */
+    if(count($this->allowedBases) && !isset($this->allowedBases[$this->selectedBase])){
+      $this->selectedBase = $old_base;
+    }
   }
 }
 // vim:tabstop=2:expandtab:shiftwidth=2:filetype=php:syntax:ruler:
index 0d4312b48f31b933e41f3758053444cf4c71721f..43634baf83317e80b930c12cc02eea9b079976b9 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->dialog = new baseSelectDialog($this->config,$this,$this->acl_get_bases());
         $this->dialog->setCurrentBase($this->base);
         $this->baseSelection = true;
       }
@@ -362,7 +362,7 @@ class printgeneric extends plugin
     }
 
     /* Fill templating stuff */
-    $smarty->assign("bases", $this->config->idepartments);
+    $smarty->assign("bases", $this->acl_get_bases());
     $smarty->assign("base_select", $this->base);
 
     /* Assign attributes */