From: hickert Date: Tue, 11 Apr 2006 05:45:45 +0000 (+0000) Subject: Added global base X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=409894b201f436f7ecccc1704b779d0912b3cda1;p=gosa.git Added global base git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3025 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/ogroups/class_ogroup.inc b/plugins/admin/ogroups/class_ogroup.inc index 0cf122946..f92b573b4 100644 --- a/plugins/admin/ogroups/class_ogroup.inc +++ b/plugins/admin/ogroups/class_ogroup.inc @@ -81,8 +81,8 @@ class ogroup extends plugin } register_global("ogfilter", $ogfilter); - if(isset($_SESSION['ogroupfilter']['depselect'])){ - $this->base = $_SESSION['ogroupfilter']['depselect']; + if(isset($_SESSION['CurrentMainBase'])){ + $this->base = $_SESSION['CurrentMainBase']; } /* set permissions */ diff --git a/plugins/admin/ogroups/class_ogroupManagement.inc b/plugins/admin/ogroups/class_ogroupManagement.inc index effe4d5e7..bc6cc78e3 100644 --- a/plugins/admin/ogroups/class_ogroupManagement.inc +++ b/plugins/admin/ogroups/class_ogroupManagement.inc @@ -75,10 +75,14 @@ class ogroupManagement extends plugin "prtgroups" => "checked", "tcgroups" => "checked", "fongroups" => "checked", - "depselect" => $base, "regex" => "*"); register_global("ogroupfilter", $ogroupfilter); } + if(!isset($_SESSION['CurrentMainBase'])){ + $ui= get_userinfo(); + $base= get_base_from_people($ui->dn); + $_SESSION['CurrentMainBase'] = $base; + } } function execute() @@ -95,11 +99,15 @@ class ogroupManagement extends plugin $s_action = ""; $s_entry = ""; - foreach( array("depselect", "regex") as $type){ + foreach( array("regex") as $type){ if (isset($_POST[$type])){ $ogroupfilter[$type]= $_POST[$type]; } } + if(isset($_POST['CurrentMainBase'])){ + $_SESSION['CurrentMainBase'] = $_POST['CurrentMainBase']; + } + if (isset($_POST['Ogroup_dialog_posted'])){ foreach( array("usergroups", "groupgroups", "appgroups", "depgroups", "servergroups", "wsgroups", "prtgroups", "tcgroups", "fongroups") as $type){ @@ -161,39 +169,39 @@ class ogroupManagement extends plugin $s_entry = preg_replace("/_.$/","",$s_entry); /* Department changed? */ - if(isset($_POST['depselect']) && $_POST['depselect']){ - $ogroupfilter['depselect']= $_POST['depselect']; + if(isset($_POST['CurrentMainBase']) && $_POST['CurrentMainBase']){ + $_SESSION['CurrentMainBase'] = $_POST['CurrentMainBase']; } /* Start for New List Managment */ if(isset($_GET['act'])&&($_GET['act']=="dep_open")){ $s_action="open"; $s_entry = base64_decode($_GET['dep_id']); - $ogroupfilter['depselect']= "".$this->config->departments[trim($s_entry)]; + $_SESSION['CurrentMainBase'] = "".$this->config->departments[trim($s_entry)]; } /* If Backbutton is Posted */ if($s_action=="back"){ - $base_back = preg_replace("/^[^,]+,/","",$ogroupfilter['depselect']); + $base_back = preg_replace("/^[^,]+,/","", $_SESSION['CurrentMainBase']); $base_back = convert_department_dn($base_back); if(isset($this->config->departments[trim($base_back)])){ - $ogroupfilter['depselect']= $this->config->departments[trim($base_back)]; + $_SESSION['CurrentMainBase']= $this->config->departments[trim($base_back)]; }else{ - $ogroupfilter['depselect']= $this->config->departments["/"]; + $_SESSION['CurrentMainBase']= $this->config->departments["/"]; } register_global("ogroupfilter", $ogroupfilter); } /* Homebutton is posted */ if($s_action=="home"){ - $ogroupfilter['depselect']=(preg_replace("/^[^,]+,/","",$this->ui->dn)); - $ogroupfilter['depselect']=(preg_replace("/^[^,]+,/","",$ogroupfilter['depselect'])); + $_SESSION['CurrentMainBase']=(preg_replace("/^[^,]+,/","",$this->ui->dn)); + $_SESSION['CurrentMainBase']=(preg_replace("/^[^,]+,/","", $_SESSION['CurrentMainBase'])); } /* root posted */ if($s_action=="root"){ - $ogroupfilter['depselect']=($this->config->current['BASE']); + $_SESSION['CurrentMainBase']=($this->config->current['BASE']); } // Edit if @@ -219,7 +227,7 @@ class ogroupManagement extends plugin */ if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){ $this->CopyPasteHandler->save_object(); - $this->CopyPasteHandler->SetVar("base",$ogroupfilter['depselect']); + $this->CopyPasteHandler->SetVar("base", $_SESSION['CurrentMainBase']); return($this->CopyPasteHandler->execute()); } @@ -408,7 +416,7 @@ class ogroupManagement extends plugin /* Prepare departments */ $options= ""; foreach ($this->config->idepartments as $key => $value){ - if ($ogroupfilter['depselect'] == $key){ + if ($_SESSION['CurrentMainBase'] == $key){ $options.= ""; } else { $options.= ""; @@ -449,7 +457,7 @@ name='dep_root' alt='"._("Root")."'> ". " ". $Copy_Paste. "  ". - _("Base")." ". + _("Base")." ". "  ". ""; @@ -563,10 +571,10 @@ name='dep_root' alt='"._("Root")."'> ". $smarty->assign("groups", $divlist->DrawList()); foreach( array("usergroups", "groupgroups", "appgroups", "depgroups", - "servergroups", "wsgroups", "prtgroups", "tcgroups", "fongroups", "regex", "depselect") as $type){ + "servergroups", "wsgroups", "prtgroups", "tcgroups", "fongroups", "regex" ) as $type){ $smarty->assign("$type", $ogroupfilter[$type]); } - + $smarty->assign("CurrentMainBase" , $_SESSION['CurrentMainBase']); $smarty->assign("hint", print_sizelimit_warning()); $smarty->assign("apply", apply_filter()); $smarty->assign("alphabet", generate_alphabet()); @@ -630,7 +638,7 @@ name='dep_root' alt='"._("Root")."'> ". $ogroupfilter= get_global('ogroupfilter'); /* Set base for all searches */ - $base= $ogroupfilter['depselect']; + $base= $_SESSION['CurrentMainBase']; /* Regex filter? */ if ($ogroupfilter['regex'] != ""){