From 7170393fe50bd906ee0415726aa0e7cdc7c6f401 Mon Sep 17 00:00:00 2001 From: hickert Date: Tue, 19 Sep 2006 04:17:54 +0000 Subject: [PATCH] Fixed base selection dialog. 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 | 8 ++++++++ plugins/admin/systems/class_printGeneric.inc | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/plugins/admin/systems/class_baseSelectDialog.inc b/plugins/admin/systems/class_baseSelectDialog.inc index fe3ccd755..0a1040c7a 100644 --- a/plugins/admin/systems/class_baseSelectDialog.inc +++ b/plugins/admin/systems/class_baseSelectDialog.inc @@ -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: diff --git a/plugins/admin/systems/class_printGeneric.inc b/plugins/admin/systems/class_printGeneric.inc index 0d4312b48..43634baf8 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->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 */ -- 2.30.2