From: hickert Date: Wed, 13 Aug 2008 07:35:55 +0000 (+0000) Subject: Fixed default release selection. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=9f60ee3c177fe56179b6ab8268e81115af45f830;p=gosa.git Fixed default release selection. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12201 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-plugins/fai/admin/fai/class_faiManagement.inc b/gosa-plugins/fai/admin/fai/class_faiManagement.inc index e1bea00f6..a80b4b93c 100644 --- a/gosa-plugins/fai/admin/fai/class_faiManagement.inc +++ b/gosa-plugins/fai/admin/fai/class_faiManagement.inc @@ -75,11 +75,15 @@ class faiManagement extends plugin /* Set default release */ $this->fai_base = get_ou("faiou").$this->config->current['BASE']; + if(!session::is_set("fai_filter")){ /* Set intial release */ $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu")); - if(empty($rel)){ + $rels = array_flip($this->getBranches()); + if(isset($rels[$rel])){ + $rel = $rels[$rel]; + }else{ $rel = $this->fai_base; } @@ -95,6 +99,7 @@ class faiManagement extends plugin /* Call parent execute */ plugin::execute(); + /* Initialise vars and smarty */ $smarty = get_smarty(); $smarty->assign("BranchName",""); diff --git a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc index 7d028102d..b3cce2714 100644 --- a/gosa-plugins/goto/admin/applications/class_applicationManagement.inc +++ b/gosa-plugins/goto/admin/applications/class_applicationManagement.inc @@ -77,20 +77,23 @@ class applicationManagement extends plugin if(!$this->IsReleaseManagementActivated()){ $this->app_base = get_ou("applicationou").$this->config->current['BASE']; if(!session::is_set("app_filter")){ - - /* Set intial release */ - $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu")); - if(empty($rel)){ - $rel = $this->app_base; - } - session::set("app_filter",array("app_base" => $rel)); + session::set("app_filter",array("app_base" => $this->app_base)); } $app_filter = session::get("app_filter"); - $this->app_base = $app_filter['app_base']; }else{ + + /* Set intial release */ $this->app_base = get_ou("applicationou").$this->config->current['BASE']; + $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu")); + $rels = array_flip($this->getReleases()); + if(isset($rels[$rel])){ + $rel = $rels[$rel]; + }else{ + $rel = $this->app_base; + } + if(!session::is_set("app_filter")){ - session::set("app_filter",array("app_base" => $this->app_base,"app_release" => $this->app_base)); + session::set("app_filter",array("app_base" => $this->app_base,"app_release" => $rel)); } $app_filter = session::get("app_filter"); $this->app_base = $app_filter['app_base']; diff --git a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc index b9d583b90..989e276a0 100644 --- a/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc +++ b/gosa-plugins/goto/admin/mimetypes/class_mimetypeManagement.inc @@ -89,8 +89,18 @@ class mimetypeManagement extends plugin $this->mime_base = $mime_filter['mime_base']; }else{ $this->mime_base = get_ou("mimetypeou").$this->config->current['BASE']; + + /* Set intial release */ + $rel = $config->search("faiManagement","DEFAULT_RELEASE",array("menu")); + $rels = array_flip($this->getReleases()); + if(isset($rels[$rel])){ + $rel = $rels[$rel]; + }else{ + $rel = $this->mime_base; + } + if(!session::is_set("mime_filter")){ - session::set("mime_filter",array("mime_base" => $this->mime_base,"mime_release" => $this->mime_base)); + session::set("mime_filter",array("mime_base" => $this->mime_base,"mime_release" => $rel)); } $mime_filter = session::get("mime_filter"); $this->mime_base = $mime_filter['mime_base'];