Code

Removed notifications from config
[gosa.git] / gosa-core / include / class_MultiSelectWindow.inc
index e32eb158cb00390dd1ff911032af806a121030cf..226e1344e545882793864dc4a136437f0f829227 100644 (file)
@@ -1,4 +1,24 @@
 <?php
+/*
+ * This code is part of GOsa (http://www.gosa-project.org)
+ * Copyright (C) 2003-2008 GONICUS GmbH
+ *
+ * ID: $$Id$$
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
 
 define ("SEPERATOR", 1002);
 
@@ -89,7 +109,7 @@ class MultiSelectWindow{
       $mid = new LayersMenu(6, 7, 2, 1);
       $mid->setImgwww("./images/");
       $mid->setIcondir("./images/");
-      $mid->setDirroot("../include/php_layers_menu/");
+      $mid->setDirroot("../include/utils/layer-menu/");
       $mid->setHorizontalMenuTpl("../ihtml/".get_template_path("",FALSE).'GOsa_MultiSelectHeader.ihtml');
       $mid->setSubMenuTpl("../ihtml/".get_template_path("",FALSE).'GOsa_MultiSelectHeaderSubEntry.ihtml');
       $mid->setMenuStructureString($this->string_ListDropDown);
@@ -114,7 +134,7 @@ class MultiSelectWindow{
                $this->CloseButtonString        = _("Close");
                $this->filterName                       = $filterName;
     $this->ui = get_userinfo();
-               $this->selectedBase = $_SESSION['CurrentMainBase'];
+               $this->selectedBase  = session::get('CurrentMainBase');
 
     /* Check default values for SaveAdditionalVars */
     $MultiDialogFilters = session::get('MultiDialogFilters');
@@ -500,7 +520,7 @@ class MultiSelectWindow{
     if(isset($_GET['act'])&& ($_GET['act'] == "dep_open")){
       $s_entry = base64_decode($_GET['dep_id']);
       if (!isset($this->config->departments[$s_entry])){
-        print_red(_("Error: The requested subtree has an inconsistent DN encoding, check your LDAP!"));
+        msg_dialog::display(_("LDAP error"), sprintf(_("Inconsistent DN encoding detected: '%s'"), LDAP::fix($s_entry)), ERROR_DIALOG);
       } else {
         $this->selectedBase = $this->config->departments[$s_entry];
       }
@@ -520,7 +540,7 @@ class MultiSelectWindow{
     if($s_action=="back"){
 
       /* Get parent deprtment and check if we are allowed to step in it */
-      $base_back= preg_replace("/^[^,]+,/", "", $_SESSION['CurrentMainBase']);
+      $base_back= preg_replace("/^[^,]+,/", "", session::get('CurrentMainBase'));
       $dep_id = $this->ui->get_module_departments($this->module);
       if(in_array_ics($base_back,$dep_id)){
 
@@ -541,14 +561,16 @@ class MultiSelectWindow{
                if(isset($_POST['MultiSelectWindow'.$this->filterName])){
 
       /* Save some additional vars */
+      $MultiDialogFilters = session::get('MultiDialogFilters');
       foreach($this->SaveAdditionalVars as $name){
         if(isset($_POST[$name])){
           if(isset($this->$name)){
             $this->$name = $_POST[$name];
-            $_SESSION['MultiDialogFilters'][$this->filterName][$name] = $_POST[$name];
+            $MultiDialogFilters[$this->filterName][$name] = $_POST[$name];
           }
         }
       }
+      session::set('MultiDialogFilters',$MultiDialogFilters);
 
                        /* Check posts from checkboxes 
                         */
@@ -560,15 +582,20 @@ class MultiSelectWindow{
                                        $this->array_Checkboxes[$key]['default'] = false;
                                        $this->$box['name'] = false;
                                }
+
                                /* Save settings in out session */
-                               $_SESSION['MultiDialogFilters'][$this->filterName][$box['name']] = $this->$box['name'];
+        $MultiDialogFilters = session::get('MultiDialogFilters');
+                               $MultiDialogFilters[$this->filterName][$box['name']] = $this->$box['name'];
+        session::set('MultiDialogFilters',$MultiDialogFilters);
                        }
 
                        /* Check regex posts */
                        foreach($this->array_Regexes as $key => $box){
                                $this->array_Regexes[$key]['value'] = $_POST[$box['name']];
                                $this->$box['name'] = $_POST[$box['name']];
-                               $_SESSION['MultiDialogFilters'][$this->filterName][$box['name']] = $this->$box['name'];
+        $MultiDialogFilters = session::get('MultiDialogFilters');
+                               $MultiDialogFilters[$this->filterName][$box['name']] = $this->$box['name'];
+        session::set('MultiDialogFilters',$MultiDialogFilters);
                        }
 
                        /* call close/save if buttons are pressed */
@@ -592,7 +619,9 @@ class MultiSelectWindow{
                                        $val = preg_replace("/\*\**/","*",$val);
                                        $this->array_Regexes[$key]['value'] = $val;
                                        $this->$box['name'] = $val;
-          $_SESSION['MultiDialogFilters'][$this->filterName][$box['name']] =  $val;
+          $MultiDialogFilters = session::get('MultiDialogFilters');
+          $MultiDialogFilters[$this->filterName][$box['name']] =  $val;
+          session::set('MultiDialogFilters',$MultiDialogFilters);
                                }
                        }
                }
@@ -660,7 +689,7 @@ class MultiSelectWindow{
                        if(!session::is_set('CurrentMainBase')){
                                session::set('CurrentMainBase',$this->config->current['BASE']);
                        }
-                       $base = $_SESSION['CurrentMainBase'];
+                       $base  = session::get('CurrentMainBase');
                }
 
                /* Create ldap obj and switch into base*/