From f9b93677ea18e1c62d042c2f404852c5d9c7fd81 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 15 Dec 2006 06:53:14 +0000 Subject: [PATCH] Fixed back button, only allowed switching to valid deps git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@5401 594d385d-05f5-0310-b6e9-bd551577e9d8 --- include/class_MultiSelectWindow.inc | 35 +++++++++++--------- plugins/gofax/faxreports/class_faxreport.inc | 3 ++ 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/include/class_MultiSelectWindow.inc b/include/class_MultiSelectWindow.inc index 6df9f2257..fee7d60ac 100644 --- a/include/class_MultiSelectWindow.inc +++ b/include/class_MultiSelectWindow.inc @@ -411,22 +411,25 @@ class MultiSelectWindow{ } - /* If Back-button is pressed, move back one step in DN */ - if($s_action=="back"){ - //FIXME: This is not 100% correct. We'll only display ou's, but there may be - // a step between. You'll stumble in a "hidden" department in this case. - $base_back= preg_replace("/^[^,]+,/", "", $_SESSION['CurrentMainBase']); - - /* The department array keeps non DN entries as index. We need to convert - it before checking the existance. */ - $base_back= trim(convert_department_dn($base_back)); - - /* Check if the department exists, otherwise revert to the configure base DN */ - if(isset($this->config->departments[$base_back])){ - $this->selectedBase= $this->config->departments[$base_back]; - }else{ - $this->selectedBase= $this->config->departments['/']; - } + /* If Back-button is pressed, move back one step in DN */ + if($s_action=="back"){ + + /* Get parent deprtment and check if we are allowed to step in it */ + $base_back= preg_replace("/^[^,]+,/", "", $_SESSION['CurrentMainBase']); + $dep_id = $this->ui->get_module_departments($this->module); + if(in_array_ics($base_back,$dep_id)){ + + /* The department array keeps non DN entries as index. We need to convert + it before checking the existance. */ + $base_back= trim(convert_department_dn($base_back)); + + /* Check if the department exists, otherwise revert to the configure base DN */ + if(isset($this->config->departments[$base_back])){ + $this->selectedBase= $this->config->departments[$base_back]; + }else{ + $this->selectedBase= $this->config->departments['/']; + } + } } $_SESSION['CurrentMainBase'] = $this->selectedBase; } diff --git a/plugins/gofax/faxreports/class_faxreport.inc b/plugins/gofax/faxreports/class_faxreport.inc index 4b892b5d5..d9b0c3d94 100644 --- a/plugins/gofax/faxreports/class_faxreport.inc +++ b/plugins/gofax/faxreports/class_faxreport.inc @@ -190,6 +190,9 @@ class faxreport extends plugin } $queuing_time= $line['queuing_time']; + /* The user is allowed to download all fax images from those users + that are listed in $_SESSION['fuserfilter'] + Don't forget to check getfax.php if you change somthing here */ $_SESSION['fuserfilter']= $this->userfilter; $smarty->assign("plug", "?plug=".validate($_GET['plug'])); $smarty->assign("detail", validate($_GET['detail'])); -- 2.30.2