From ac2054fc02451e7279cdcfd55df028338c91e32d Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 29 Jul 2005 06:21:23 +0000 Subject: [PATCH] Groups / Ogroups / Departments will be created in the selected base git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@1033 594d385d-05f5-0310-b6e9-bd551577e9d8 --- .../departments/class_departmentGeneric.inc | 6 +++++- plugins/admin/groups/class_groupGeneric.inc | 21 ++++++++++++------- plugins/admin/ogroups/class_ogroup.inc | 12 +++++------ 3 files changed, 24 insertions(+), 15 deletions(-) diff --git a/plugins/admin/departments/class_departmentGeneric.inc b/plugins/admin/departments/class_departmentGeneric.inc index b31594617..243d1e921 100644 --- a/plugins/admin/departments/class_departmentGeneric.inc +++ b/plugins/admin/departments/class_departmentGeneric.inc @@ -53,7 +53,11 @@ class department extends plugin /* Set base */ if ($this->dn == "new"){ $ui= get_userinfo(); - $this->base= dn2base($ui->dn); + if(isset($_SESSION['depfilter']['depselect'])){ + $this->base = $_SESSION['depfilter']['depselect']; + }else{ + $this->base= dn2base($ui->dn); + } } else { $this->base= preg_replace ("/^[^,]+,/", "", $this->dn); } diff --git a/plugins/admin/groups/class_groupGeneric.inc b/plugins/admin/groups/class_groupGeneric.inc index 39008f756..52df6e023 100644 --- a/plugins/admin/groups/class_groupGeneric.inc +++ b/plugins/admin/groups/class_groupGeneric.inc @@ -128,6 +128,20 @@ class group extends plugin } $gufilter= get_global('gufilter'); + /* Bases / Departments */ + + if(isset($_SESSION['groupfilter']['depselect'])){ + $this->base = $_SESSION['groupfilter']['depselect']; + }else{ + if ($this->dn == "new"){ + $ui= get_userinfo(); + $this->base= dn2base($ui->dn); + } else { + $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn); + } + } + + /* This is always an account */ $this->is_account= TRUE; $this->reload(); @@ -230,13 +244,6 @@ class group extends plugin /* Bases / Departments */ if (isset($_POST['base'])){ $this->base= $_POST['base']; - } else { - if ($this->dn == "new"){ - $ui= get_userinfo(); - $this->base= dn2base($ui->dn); - } else { - $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn); - } } $smarty->assign("bases", $this->config->idepartments); diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index c41fc5922..bbb1ada80 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -78,6 +78,10 @@ class ogroup extends plugin } } register_global("ogfilter", $ogfilter); + + if(isset($_SESSION['ogroupfilter']['depselect'])){ + $this->base = $_SESSION['ogroupfilter']['depselect']; + } /* Load member data */ $this->reload(); @@ -187,16 +191,10 @@ class ogroup extends plugin } /* Bases / Departments */ - if ($this->dn == "new"){ - $ui= get_userinfo(); - $this->base= dn2base($ui->dn); - } else { + if (isset($_POST['base'])){ $this->base= $_POST['base']; - } else { - $this->base= preg_replace ("/^[^,]+,[^,]+,/", "", $this->dn); } - } /* Assemble combine string */ if ($this->gosaGroupObjects == "[]"){ -- 2.30.2