From: hickert Date: Tue, 11 Apr 2006 05:47:54 +0000 (+0000) Subject: Added global base X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=5d9567e818a13d7405c03d9877ee68aa2900629d;p=gosa.git Added global base git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@3026 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/plugins/admin/applications/class_applicationGeneric.inc b/plugins/admin/applications/class_applicationGeneric.inc index 2b5e5a645..da52cb304 100644 --- a/plugins/admin/applications/class_applicationGeneric.inc +++ b/plugins/admin/applications/class_applicationGeneric.inc @@ -56,8 +56,8 @@ class application extends plugin $this->is_account= TRUE; if ($this->dn == "new"){ - if(isset($_SESSION['appfilter']['depselect'])){ - $this->base=$_SESSION['appfilter']['depselect']; + if(isset($_SESSION['CurrentMainBase'])){ + $this->base= $_SESSION['CurrentMainBase']; }else{ $ui= get_userinfo(); $this->base= dn2base($ui->dn); diff --git a/plugins/admin/applications/class_applicationManagement.inc b/plugins/admin/applications/class_applicationManagement.inc index 18bec3eaf..cb57824d0 100644 --- a/plugins/admin/applications/class_applicationManagement.inc +++ b/plugins/admin/applications/class_applicationManagement.inc @@ -64,15 +64,17 @@ class applicationManagement extends plugin if (!is_global("appfilter")){ $base= get_base_from_people($ui->dn); - $appfilter= array("depselect" => $base, - "regex" => "*" , + $appfilter= array("regex" => "*" , "release" => "ou=apps,".$base); - register_global("appfilter", $appfilter); } $appfilter = get_global("appfilter"); - $this->Releases = $this->getReleases($appfilter['depselect']); + if(!isset($_SESSION['CurrentMainBase'])){ + $_SESSION['CurrentMainBase'] = get_base_from_people($ui->dn); + } + + $this->Releases = $this->getReleases($_SESSION['CurrentMainBase']); asort($this->Releases); $this->Release = $appfilter['release']; } @@ -124,7 +126,7 @@ class applicationManagement extends plugin if(isset($_GET['act'])&&($_GET['act']=="dep_open")){ $s_action="open"; $s_entry = base64_decode($_GET['dep_id']); - $appfilter['depselect']= "".$this->config->departments[trim($s_entry)]; + $_SESSION['CurrentMainBase']= "".$this->config->departments[trim($s_entry)]; } /* Get posted release */ @@ -177,29 +179,29 @@ class applicationManagement extends plugin $s_entry = preg_replace("/_.$/","",$s_entry); /* Department changed? */ - if(isset($_POST['depselect']) && $_POST['depselect']){ - $appfilter['depselect']= $_POST['depselect']; + if(isset($_POST['CurrentMainBase']) && $_POST['CurrentMainBase']){ + $_SESSION['CurrentMainBase']= $_POST['CurrentMainBase']; } /* Homebutton is posted */ if($s_action=="home"){ - $appfilter['depselect']=(preg_replace("/^[^,]+,/","",$this->ui->dn)); - $appfilter['depselect']=(preg_replace("/^[^,]+,/","",$appfilter['depselect'])); + $_SESSION['CurrentMainBase']=(preg_replace("/^[^,]+,/","",$this->ui->dn)); + $_SESSION['CurrentMainBase']=(preg_replace("/^[^,]+,/","",$_SESSION['CurrentMainBase'])); } if($s_action=="root"){ - $appfilter['depselect']=($this->config->current['BASE']); + $_SESSION['CurrentMainBase']=($this->config->current['BASE']); } /* If Backbutton is Posted */ if($s_action=="back"){ - $base_back = preg_replace("/^[^,]+,/","",$appfilter['depselect']); + $base_back = preg_replace("/^[^,]+,/","",$_SESSION['CurrentMainBase']); $base_back = convert_department_dn($base_back); if(isset($this->config->departments[trim($base_back)])){ - $appfilter['depselect']= $this->config->departments[trim($base_back)]; + $_SESSION['CurrentMainBase']= $this->config->departments[trim($base_back)]; }else{ - $appfilter['depselect']= $this->config->departments["/"]; + $_SESSION['CurrentMainBase']= $this->config->departments["/"]; } } @@ -214,7 +216,7 @@ class applicationManagement extends plugin $appfilter['regex']= $s; } - $this->Releases = $this->getReleases($appfilter['depselect']); + $this->Releases = $this->getReleases($_SESSION['CurrentMainBase']); asort($this->Releases); if(!isset($this->Releases[$this->Release])){ $this->Release = key($this->Releases); @@ -242,7 +244,8 @@ class applicationManagement extends plugin */ if(($s_action == "editPaste") || ($this->CopyPasteHandler->stillOpen())){ $this->CopyPasteHandler->save_object(); - $this->CopyPasteHandler->SetVar("base",$appfilter['depselect']); + $this->CopyPasteHandler->SetVar("base", $_SESSION['CurrentMainBase']); + return($this->CopyPasteHandler->execute()); } @@ -440,7 +443,7 @@ class applicationManagement extends plugin /* Prepare departments */ $options= ""; foreach ($this->config->idepartments as $key => $value){ - if ($appfilter['depselect'] == $key){ + if ($_SESSION['CurrentMainBase']== $key){ $options.= ""; } else { $options.= ""; @@ -477,7 +480,7 @@ class applicationManagement extends plugin "  ". $Copy_Paste. "  ". - _("Base")." ". + _("Base")." ". "  ". ""; @@ -620,7 +623,7 @@ class applicationManagement extends plugin */ $peopleOU = get_people_ou(); - $base2 = $appfilter['depselect']; + $base2 = $_SESSION['CurrentMainBase']; $res3 = get_list2($this->ui->subtreeACL, "(&(|(ou=$regex)(description=$regex))(objectClass=gosaDepartment))", TRUE, $base2, array("ou", "description"), TRUE);