Code

Some additional Session fixes.
authorhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Jan 2008 10:04:04 +0000 (10:04 +0000)
committerhickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 4 Jan 2008 10:04:04 +0000 (10:04 +0000)
- Only /plugins/admin/fai/ isn't fixed yet

git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8211 594d385d-05f5-0310-b6e9-bd551577e9d8

45 files changed:
gosa-core/plugins/addons/godfs/main.inc
gosa-core/plugins/addons/gotomasses/main.inc
gosa-core/plugins/addons/ldapmanager/main.inc
gosa-core/plugins/addons/logview/class_gosa_logview.inc
gosa-core/plugins/addons/logview/main.inc
gosa-core/plugins/addons/mailqueue/main.inc
gosa-core/plugins/addons/notifications/main.inc
gosa-core/plugins/admin/acl/main.inc
gosa-core/plugins/admin/applications/class_applicationGeneric.inc
gosa-core/plugins/admin/applications/class_divListApplication.inc
gosa-core/plugins/admin/applications/main.inc
gosa-core/plugins/admin/departments/class_departmentManagement.inc
gosa-core/plugins/admin/departments/main.inc
gosa-core/plugins/admin/devices/class_deviceManagement.inc
gosa-core/plugins/admin/devices/main.inc
gosa-core/plugins/admin/groups/class_groupGeneric.inc
gosa-core/plugins/admin/groups/main.inc
gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc
gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc
gosa-core/plugins/admin/mimetypes/main.inc
gosa-core/plugins/admin/ogroups/class_phonequeue.inc
gosa-core/plugins/admin/ogroups/main.inc
gosa-core/plugins/admin/systems/class_printGeneric.inc
gosa-core/plugins/admin/systems/class_systemManagement.inc
gosa-core/plugins/admin/systems/class_workstationStartup.inc
gosa-core/plugins/admin/systems/main.inc
gosa-core/plugins/admin/systems/ppd/class_printerPPDSelectionDialog.inc
gosa-core/plugins/admin/systems/services/dns/class_termDNS.inc
gosa-core/plugins/admin/systems/services/glpi/class_glpiAttachmentPool.inc
gosa-core/plugins/admin/systems/services/glpi/class_glpiSelectUser.inc
gosa-core/plugins/admin/systems/services/gofon/class_goFonServer.inc
gosa-core/plugins/admin/users/main.inc
gosa-core/plugins/gofax/blocklists/main.inc
gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc
gosa-core/plugins/gofax/faxaccount/main.inc
gosa-core/plugins/gofax/faxreports/class_faxreport.inc
gosa-core/plugins/gofax/faxreports/main.inc
gosa-core/plugins/gofon/conference/class_phoneConferenceGeneric.inc
gosa-core/plugins/gofon/conference/main.inc
gosa-core/plugins/gofon/fonreports/main.inc
gosa-core/plugins/gofon/macro/class_gofonMacro.inc
gosa-core/plugins/gofon/macro/class_gofonMacroParameters.inc
gosa-core/plugins/gofon/macro/main.inc
gosa-core/plugins/gofon/phoneaccount/main.inc
gosa-core/setup/main.inc

index 6e15fe929f03e5395d30594e1594beb798b2726d..4ade21848ac5d872a3d63f83e51fb2876d444111 100644 (file)
@@ -10,7 +10,7 @@
      # create dfsManagment object
      if (!session::is_set('dfsManagment') || 
         (isset($_GET['reset']) && $_GET['reset'] == 1)) {
-       $_SESSION['dfsManagment'] = new dfsManagment($config, $_SESSION['ui']);
+       session::set('dfsManagment',new dfsManagment($config, session::get('ui')));
      }
      $dfsManagment  = session::get('dfsManagment');
      $output = $dfsManagment->execute();
@@ -27,7 +27,7 @@
                                 _("Distributed File System Administration"),
                                 "<img alt=\"\" class=\"center\" src=\"".
                                 get_template_path('images/closedlock.png').
-                                "\"> ".$_SESSION['objectinfo']);
+                                "\"> ".session::get('objectinfo'));
      } else {
        $display = print_header(get_template_path('images/dfs.png'),
                                 _("Distributed File System Administration"));
index f83100d1573ff69f96d6d59931553f8358255090..7a517fecddfe866cfdd7cc455efa41bb4cd4a761 100644 (file)
@@ -22,21 +22,20 @@ if (!$remove_lock){
 
        /* Create gotomasses object on demand */
        if (!session::is_set('gotomasses') || (isset($_GET['reset']) && $_GET['reset'] == 1) || isset($_POST['reload_gotomass_data'])){
-               $_SESSION['gotomasses']= new gotomasses ($config);
-               $_SESSION['gotomasses']->set_acl_category("gotomasses");
+               $gotomasses= new gotomasses ($config);
+               $gotomasses->set_acl_category("gotomasses");
 
         /* Check root dn and user dn for acl informations */
-        $_SESSION['gotomasses']->set_acl_base($config->current['BASE']);
-        if($_SESSION['gotomasses']->getacl("") == ""){
-            $_SESSION['gotomasses']->set_acl_base($ui->dn);
+        $gotomasses->set_acl_base($config->current['BASE']);
+        if($gotomasses->getacl("") == ""){
+            $gotomasses->set_acl_base($ui->dn);
         }
                
                /* Check if we have acl on our own base */
-        if($_SESSION['gotomasses']->getacl("") == ""){
-            $_SESSION['gotomasses']->set_acl_base(dn2base($ui->dn));
+        if($gotomasses->getacl("") == ""){
+            $gotomasses->set_acl_base(dn2base($ui->dn));
         }
-       
-       
+               session::set("gotomasses",$gotomasses);
        }
        $gotomasses = session::get('gotomasses');
 
index bef58098eb7ecf53daa7f1bac1557f1471eac1d0..c1d0b9d7cb84a3c056d1215a3e854a91044bd97f 100644 (file)
@@ -21,8 +21,9 @@
 if (!$remove_lock){
        /* Create phonelist object on demand */
        if (!session::is_set('ldif') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['ldif']= new ldif ($config);
-               $_SESSION['ldif']->set_acl_category("logview");
+               $ldif= new ldif ($config);
+               $ldif->set_acl_category("logview");
+               session::set('ldif',$ldif);
        }
        $ldif = session::get('ldif');
 
index 05be42da355df0f2e0b235ba78286f14bde7fb52..2ad6e9348b1c1daeea1a40c12490973096278a0c 100644 (file)
@@ -368,11 +368,12 @@ class gosa_logview extends plugin
       }
 
       /* Save attributes in Sessiob, so we are able to recontruct filter on plugin reload */
-      $_SESSION['logview']['gosa_log'] = array();
+      $logview = session::get('logview');
+      $logview['gosa_log'] = array();
       foreach(array("action","server","time","regex") as $attr){
-        $_SESSION['logview']['gosa_log'][$attr] = $this->$attr;
+        $logview['gosa_log'][$attr] = $this->$attr;
       }
-
+      session::set('logview',$logview);
     }
   }
 
index 7cea93586407fd6942678ec224b38c977b213100..5df3535ec9b33fe0579aa807aa8adafa8e24f6a7 100644 (file)
@@ -21,7 +21,7 @@ if (!$remove_lock){
 
        /* Create logview object on demand */
        if (!session::is_set('log_tabs') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['log_tabs']= new log_tabs($config, $config->data['TABS']['LOGTABS'],"");
+               session::set('log_tabs',new log_tabs($config, $config->data['TABS']['LOGTABS'],""));
        }
        $log_tabs = session::get('log_tabs');
 
index eba85f1daaae1f25f8bd3e8c185b94a6d9178888..2e0f274d08de8805620f893d20edcd938e085cfe 100644 (file)
@@ -22,14 +22,15 @@ if (!$remove_lock){
        /* Create mailqueue object on demand */
        if (!session::is_set('mailqueue') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
                $ui = get_userinfo();
-               $_SESSION['mailqueue']= new mailqueue ($config);
-               $_SESSION['mailqueue']->set_acl_category("mailqueue");
+               $mailqueue= new mailqueue ($config);
+               $mailqueue->set_acl_category("mailqueue");
                
                /* Check root dn and user dn for acl informations */
-               $_SESSION['mailqueue']->set_acl_base($config->current['BASE']);
-               if($_SESSION['mailqueue']->getacl("") == ""){
-                       $_SESSION['mailqueue']->set_acl_base($ui->dn);
+               $mailqueue->set_acl_base($config->current['BASE']);
+               if($mailqueue->getacl("") == ""){
+                       $mailqueue->set_acl_base($ui->dn);
                }
+               session::set('mailqueue',$mailqueue);
        }
        $mailqueue = session::get('mailqueue');
 
index 00c0cdae454618b83596b60ee75361143a111f2a..fa90571d0918d70e6384e45edbf58cda2ccb5979 100644 (file)
 */
 
 if (!$remove_lock){
-        /* Create msgplug object on demand */
-        if (!session::is_set('msgplug') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-                $ui = get_userinfo();
-                $_SESSION['msgplug']= new msgplug ($config);
-                $_SESSION['msgplug']->set_acl_category("msgplug");
-
-                /* Check root dn and user dn for acl informations */
-                $_SESSION['msgplug']->set_acl_base($config->current['BASE']);
-                if($_SESSION['msgplug']->getacl("") == ""){
-                        $_SESSION['msgplug']->set_acl_base($ui->dn);
-                }
-        }
+       /* Create msgplug object on demand */
+       if (!session::is_set('msgplug') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
+               $ui = get_userinfo();
+               $msgplug= new msgplug ($config);
+               $msgplug->set_acl_category("msgplug");
+
+               /* Check root dn and user dn for acl informations */
+               $msgplug->set_acl_base($config->current['BASE']);
+               if($msgplug->getacl("") == ""){
+                       $msgplug->set_acl_base($ui->dn);
+               }
+               session::set('msgplug',$msgplug);
+       }
        $msgplug = session::get('msgplug');
 
        /* save changes back to object */
index 87dc4299bfe3e8f84775c62294912fc42fca1f0d..abdbb345159cdfe27db2da24f4abfabca36026ca 100644 (file)
@@ -30,7 +30,7 @@ if ($remove_lock){
 
        /* Create usermanagement object on demand */
 if (!session::is_set('macl') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-       $_SESSION['macl']= new aclManagement($config, $ui);
+               session::set('macl',new aclManagement($config, $ui));
        }
        $macl = session::get('macl');
        
index e150b0622353db5b2c97d050c8228287df6a280e..daa97d63720ecbe65d002c0ea504e4778265e169 100644 (file)
@@ -33,9 +33,11 @@ class application extends plugin
   {
     plugin::plugin ($config, $dn, $parent);
 
+    $appfilter = session::get('appfilter')    ;
+
     $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs'));
     if(!empty($tmp)) {
-      if(!preg_match("/^".get_ou('applicationou')."/",$_SESSION['appfilter']['release'])){
+      if(!preg_match("/^".get_ou('applicationou')."/",$appfilter['release'])){
         $this->isReleaseApplikation = true;  
       }
     }
index 8177d512966a4950cb172e89a2c69ab8f9c61a97..f70d5c618d77ffe1444cd438f4f96308e8257207 100755 (executable)
@@ -22,7 +22,7 @@ class divListApplication extends MultiSelectWindow
   {
     MultiSelectWindow::MultiSelectWindow($config,"Application", "application");
    
-    $this->selectedRelease = get_ou('applicationou').$_SESSION['CurrentMainBase'];
+    $this->selectedRelease = get_ou('applicationou').session::get('CurrentMainBase');
  
     $this->parent       = &$parent;
     $this->ui           = get_userinfo();
@@ -313,7 +313,9 @@ class divListApplication extends MultiSelectWindow
   {
     /* Save automatic created POSTs like regex, checkboxes */
     MultiSelectWindow::save_object(); 
-    $_SESSION['appfilter']['release']  = $this->selectedRelease;
+    $appfilter = session::get('appfilter');
+    $appfilter['release']  = $this->selectedRelease;
+    session::set('appfilter',$appfilter);
   }
 
 }
index b5152b89c6d9084ad4d647d0e48efb6d11d94538..4595ef7c2e5c4293f4d91a3822a57068b3ff305d 100644 (file)
@@ -28,7 +28,7 @@ if ($remove_lock){
 } else {
        /* Create applicationManagement object on demand */
        if (!session::is_set('applicationManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['applicationManagement']= new applicationManagement ($config, $_SESSION['ui']);
+               session::set('applicationManagement',new applicationManagement ($config, session::get('ui')));
        }
        $applicationManagement = session::get('applicationManagement');
        $applicationManagement->save_object();
index 5eef200994725951d4d1f0dc10d42c7ed6718c58..c8577edb2b2d6a6e52a4dbf9028fb9c109e7e50b 100644 (file)
@@ -430,7 +430,8 @@ class departmentManagement extends plugin
     $Regex        = $this->DivListDepartment->Regex;
   
     // Create Array to Test if we have a valid back button
-    $tmp = $_SESSION['config']->idepartments;
+    $config = session::get('config');
+    $tmp = $config->idepartments;
 
     // In case of a valid back button create entry
     if(isset($tmp[$base_back])){
index 6f94c64f73bc9150deae8630036b7c1e4e999a17..c53038453fa00e73ada2e5ab9983c2d9322c470f 100644 (file)
@@ -28,7 +28,7 @@ if ($remove_lock){
 } else {
        /* Create usermanagement object on demand */
        if (!session::is_set('department') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['department']= new departmentManagement($config, $ui);
+               session::set('department',new departmentManagement($config, $ui));
        }
        $department = session::get('department');
        
index d66e15c39edcc0245f314728fd5f488d3b5d4c61..77c5825754608993781e12d911a079647c2ee4c8 100644 (file)
@@ -43,8 +43,8 @@ class deviceManagement extends plugin
 
     /* These vars will be stored if you try to open a locked device,
         to be able to perform your last requests after showing a warning message */
-    $_SESSION['LOCK_VARS_TO_USE'] = array("/^act$/","/^id$/","/^device_edit_/",
-                                          "/^device_del_/","/^item_selected/","/^remove_multiple_devices/");
+    session::set('LOCK_VARS_TO_USE',array("/^act$/","/^id$/","/^device_edit_/",
+                                          "/^device_del_/","/^item_selected/","/^remove_multiple_devices/"));
 
     $smarty       = get_smarty();             // Smarty instance
     $s_action     = "";                       // Contains the action to proceed
index 115971c008110795a9ff48e148f458f548d51b02..51cf4d6a2d5c64370b4462dec58c2061c77c543d 100755 (executable)
@@ -29,7 +29,7 @@ if ($remove_lock){
 
                /* Create DeviceManagement object on demand */
                if (!session::is_set('DeviceManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-                               $_SESSION['DeviceManagement']= new deviceManagement ($config);
+                       session::set('DeviceManagement',new deviceManagement ($config));
                }
 
                /* Get object */
index 9da0acb1eaf55fa253a94ad37f7732ee9279f445..1d9007401823af649e51534f7d6142f1213d897b 100644 (file)
@@ -151,12 +151,9 @@ class group extends plugin
           "regex"           => "*");
       register_global("gufilter", $gufilter);
     }
-    $gufilter= get_global('gufilter');
-
+    $gufilter= session::get('gufilter');
     $gufilter['SubSearchGroup'] = false;
-    $gufilter['dselect'] = $_SESSION['gufilter']['dselect'];  
-
-    register_global('gufilter',$gufilter);
+    session::set('gufilter',$gufilter);
   
     if ($this->dn == "new"){
       if(session::is_set('CurrentMainBase')){
index 23976c113607bad8b61f5f043046d9aa716949c3..e86d46c926fd5a812add42caa4a776e7cd18135c 100644 (file)
@@ -28,7 +28,7 @@ if ($remove_lock){
 } else {
   /* Create groupManagement object on demand */
   if (!session::is_set('groupManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-    $_SESSION['groupManagement']= new groupManagement ($config, $_SESSION['ui']);
+    session::set('groupManagement',new groupManagement ($config, session::get('ui')));
   }
   $groupManagement = session::get('groupManagement');
   $groupManagement->save_object();
index c9426f75cad2abaa0a5f1c8fc4a314852a09420b..da73758aaecd88bc91eebf4f559837ab4010d1c3 100755 (executable)
@@ -26,7 +26,7 @@ class divListMimeTypes extends MultiSelectWindow
     MultiSelectWindow::MultiSelectWindow($config, "Mimetypes", "mimetypes");
   
     /* initialize required attributes */ 
-    $this->selectedRelease  = get_ou('mimetypeou').$_SESSION['CurrentMainBase'];
+    $this->selectedRelease  = get_ou('mimetypeou').session::get('CurrentMainBase');
     $this->parent           = &$parent;
     $this->ui               = get_userinfo();
     $this->AvailableReleases= $this->parent->getReleases($this->selectedBase);
@@ -335,7 +335,9 @@ class divListMimeTypes extends MultiSelectWindow
     if(!isset($this->AvailableReleases[$this->selectedRelease])){
       $this->selectedRelease =key($this->AvailableReleases);
     }
-    $_SESSION['mimefilter']['release']  = $this->selectedRelease;
+    $mimefilter = session::get('mimefilter');
+    $mimefilter['release']  = $this->selectedRelease;
+    session::set('mimefilter',$mimefilter);
   }
 
 }
index 67d383873ce7bb7f0443b532fb4a3cb382b617dc..1895e163a6b78d380b01f037f96759cb5914b8f5 100644 (file)
@@ -151,8 +151,8 @@ class mimetype extends plugin
     if ($this->iconData == ""){
       $this->set_new_picture("");
     }
-    $_SESSION['binary']                        = $this->iconData;
-    $_SESSION['binarytype']            = "image/jpeg";
+    session::set('binary',$this->iconData);
+    session::set('binarytype',"image/jpeg");
   }
 
 
@@ -541,8 +541,8 @@ class mimetype extends plugin
     $mimefilter = session::get('mimefilter');
   
     if($this->isReleaseMimeType && (isset($mimefilter['release']))){
-      $baseDn = str_replace($this->config->current['BASE'],$this->base,$_SESSION['mimefilter']['release']);
-      $baseDn = preg_replace("/".get_ou('mimetypeou').".*/",get_ou('mimetypeou').$this->base,$_SESSION['mimefilter']['release']);
+      $baseDn = str_replace($this->config->current['BASE'],$this->base,$mimefilter['release']);
+      $baseDn = preg_replace("/".get_ou('mimetypeou').".*/",get_ou('mimetypeou').$this->base,$mimefilter['release']);
       $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))",$baseDn,array("cn"));
       if($ldap->count()){
         $attrs = $ldap->fetch();
index 5f37b1b757f88e9929200b37dbec1110845e6879..36059d99e475d6777a86adf9624db6ca26da4767 100755 (executable)
@@ -29,7 +29,7 @@ if ($remove_lock){
 
                /* Create MimeTypeManagement object on demand */
                if (!session::is_set('MimeTypeManagement') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-                               $_SESSION['MimeTypeManagement']= new mimetypeManagement ($config, $_SESSION['ui']);
+                       session::set('MimeTypeManagement',new mimetypeManagement ($config, session::get('ui')));
                }
 
                /* Get object */
index f67ee78d8a566eb73423ddef8721ecacc3468ead..2a5cfb6a635d745e6aa97390114d9b0dc488db9f 100644 (file)
@@ -71,15 +71,12 @@ class phonequeue extends plugin
      * Load all server configuration in $this->goFonHomeServers if available
      *  and use first server as default if necessary.
      */
-    if(array_key_exists('config',$_SESSION) &&
-        array_key_exists('SERVERS',$_SESSION['config']->data) &&
-        array_key_exists('FON',$_SESSION['config']->data['SERVERS']) &&
-        count($_SESSION['config']->data['SERVERS']['FON']) &&
-        is_callable("mysql_connect")
-      ) {
+    if(isset($config->data['SERVERS']['FON']) && 
+       count($config->data['SERVERS']['FON']) &&
+       is_callable("mysql_connect")){
 
       /* Set available server */
-      $this->goFonHomeServers = $_SESSION['config']->data['SERVERS']['FON'];
+      $this->goFonHomeServers = $config->data['SERVERS']['FON'];
 
       /* Set default server */
       if($this->dn == "new"){
index 4172b4165a8c67ed07ebc891d550fe64f2784bfb..18c8fde193ef2dd27b1febbb737c9ed4277715e7 100644 (file)
@@ -21,7 +21,7 @@
 if (!$remove_lock){
   /* Create object object on demand */
   if (!session::is_set('ogroup') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-    $_SESSION['ogroup']= new ogroupManagement ($config);
+    session::set('ogroup',new ogroupManagement ($config));
   }
   $ogroup = session::get('ogroup');
 
index f289b4dc0c7a5f42d820cf4b128657a677b5746c..3020e0d5a245d73ec33b98c63d7d638ecd781395 100644 (file)
@@ -106,7 +106,7 @@ class printgeneric extends plugin
       }
 
       if(!isset($this->config->idepartments[$this->base])){
-        print_red(_("Can't extract a valid base out of object dn, setting base to '%s'."),$_SESSION['CurrentMainBase']);
+        print_red(_("Can't extract a valid base out of object dn, setting base to '%s'."),session::get('CurrentMainBase'));
         $this->base  = session::get('CurrentMainBase');
       }
     }
@@ -505,7 +505,7 @@ class printgeneric extends plugin
     $config = session::get('config');
     if((isset($config->data['MAIN']['PPD_PATH']))&&(is_dir($config->data['MAIN']['PPD_PATH']))){
 
-      $path = $_SESSION['config']->data['MAIN']['PPD_PATH'];
+      $path = $config->data['MAIN']['PPD_PATH'];
       if(!preg_match("/\/$/",$path)){
         $path = $path."/";
       }
index 7d052d2072926e95546f0e8e7440f79d7b5c97c4..73a64aec9f988fb9a0a794bdbc4b4140b7ad074c 100644 (file)
@@ -108,10 +108,12 @@ class systems extends plugin
      * Display the new requested entry type ... servtab  in case of server and so on.
      */
     if(isset($_POST['SystemTypeChoosen'])){
+      $SelectedSystemType = session::get('SelectedSystemType');
       $s_action = "SelectedSystemType";
       $s_entry  = $_POST['SystemType'];
-      $_SESSION['SelectedSystemType']['ogroup'] = $_POST['ObjectGroup'];
+      $SelectedSystemType['ogroup'] = $_POST['ObjectGroup'];
       $this->systab = NULL;
+      session::set('SelectedSystemType',$SelectedSystemType);
     }
 
     /* remove image tags from posted entry  (posts looks like this 'name_x')*/
@@ -746,7 +748,7 @@ class systems extends plugin
       if (count($message) == 0){
 
         /* Incoming behavior; you can select a system type and an ogroup membership.
-         * If this object is an Incoming object, $_SESSION['SelectedSystemType'] isset.
+         * If this object is an Incoming object, session::get('SelectedSystemType') isset.
          * Check if we must add the new object to an object group.
          *
          * If this is done, delete the old incoming entry... it is still there, because this is a new
index aec2da2aea7418e95e9ce8d790c080692df0f6ce..be1aad21dbae16ae6d252d164295df4db1a33258 100644 (file)
@@ -127,7 +127,9 @@ class workstartup extends plugin
           $attr['description'][0] ="";
         }
 
-        $_SESSION['getAvailableClassesForThisRelease_CACHED_CLASSES'][] = $attr;
+        $getAvailableClassesForThisRelease_CACHED_CLASSES = session::get('getAvailableClassesForThisRelease_CACHED_CLASSES');
+        $getAvailableClassesForThisRelease_CACHED_CLASSES[] = $attr;
+        session::set('getAvailableClassesForThisRelease_CACHED_CLASSES',$getAvailableClassesForThisRelease_CACHED_CLASSES);
    
         if(in_array('FAIpackageList',$attr['objectClass'])){
           $tmp2[$cn]['FAIpackageList']['obj']   = 'FAIpackageList'; 
@@ -449,7 +451,9 @@ class workstartup extends plugin
       $attr = $ldap->fetch();
       $test2[$attr['cn'][0]] = $attr['cn'][0];
     }
-    $_SESSION['getAvailableClassesForThisRelease_CACHE'][$release] = $test2;
+    $getAvailableClassesForThisRelease_CACHE = session::get('getAvailableClassesForThisRelease_CACHE');
+    $getAvailableClassesForThisRelease_CACHE[$release] = $test2;
+    session::set('getAvailableClassesForThisRelease_CACHE',$getAvailableClassesForThisRelease_CACHE);
     return($test2);
   }
 
index e2b0f6f230676fb1c8918e2878454dc8e4464185..98793774809fdd19b83fbccefae74f2c862dc47b 100644 (file)
@@ -28,7 +28,7 @@ if ($remove_lock){
 } else {
        /* Create usermanagement object on demand */
        if (!session::is_set('systems') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['systems']= new systems($config, $ui);
+               session::set('systems',new systems($config, $ui));
        }
        $systems = session::get('systems');
        $systems->save_object();
index 450da93475ce9e930c9d19650df32359b6b218d5..ee58130629a6f9daf5a4fe8e082ee17dd56f999c 100644 (file)
@@ -25,7 +25,7 @@ class printerPPDSelectionDialog extends plugin
     $this->depselect  = $this->config->current['BASE'];
     
     if(!session::is_set('printerPPDSelectionDialog')){
-      $_SESSION['printerPPDSelectionDialog']['regex'] = "*";
+      session::set("printerPPDSelectionDialog",array('regex'=> "*"));
     }  
 
     /* Order the manufacturers index */
@@ -41,8 +41,9 @@ class printerPPDSelectionDialog extends plugin
     $smarty= get_smarty();
     $display= "";
     $s_action = "none";
-  
-    $regex = $_SESSION['printerPPDSelectionDialog']['regex'];
+    $printerPPDSelectionDialog = session::get('printerPPDSelectionDialog');
+    $regex = $printerPPDSelectionDialog['regex'];
 
     if(isset($_GET['search'])){
       $regex = $_GET['search']."*";
@@ -53,7 +54,8 @@ class printerPPDSelectionDialog extends plugin
     }
     
     $regex = str_replace("**","*",$regex);
-    $_SESSION['printerPPDSelectionDialog']['regex'] = $regex;
+    $printerPPDSelectionDialog['regex'] = $regex;
+    session::set('printerPPDSelectionDialog',$printerPPDSelectionDialog);
  
 
     /* Delete requested, check if everything is ok and display confirmation dialog */
index 025933291e6aebd46ae0fec893cb435652aa65eb..f64650f26ffe0085e17a383db591e3b6bf14b203 100644 (file)
@@ -859,7 +859,8 @@ class termDNS extends plugin
 
     /* Hide all dns specific code, if dns is not available
      */
-    foreach($_SESSION['config']->data['TABS']['SERVERSERVICE'] as $tab){
+    $config = session::get('config');
+    foreach($config->data['TABS']['SERVERSERVICE'] as $tab){
       if(preg_match("/^servdns$/",$tab['CLASS'])){
         $tmp['plProvidedAcls']["Records"]        = _("DNS records");
         $tmp['plProvidedAcls']["zoneName"]       = _("Zone name");
index d315cebf8c34a1c4619c6ca52da2d472443e7d7f..df2bae08db7c2e49f0057688ceb8288bdbf4a90e 100644 (file)
@@ -261,6 +261,8 @@ class glpiAttachmentPool extends plugin
       name='new_attach' alt='"._("New Attachment"). "'>&nbsp;".
       "</div>";
 
+    $GlpiAttachmentFilter = session::get('GlpiAttachmentFilter');
+  
     $smarty->assign("attachments",      $divlist->DrawList());
     $smarty->assign("attachmenthead",   $listhead);
     $smarty->assign("search_image",     get_template_path('images/search.png'));
@@ -270,7 +272,7 @@ class glpiAttachmentPool extends plugin
     $smarty->assign("launchimage",      get_template_path('images/small_filter.png'));
     $smarty->assign("apply",            apply_filter());
     $smarty->assign("alphabet",         generate_alphabet());
-    $smarty->assign("attachment_regex", $_SESSION['GlpiAttachmentFilter']['filter']);
+    $smarty->assign("attachment_regex", $GlpiAttachmentFilter['filter']);
 
     $display.= $smarty->fetch(get_template_path('glpiAttachmentPool.tpl', TRUE));
     return($display);
index 5b0ec6708d18ffe0eb12ed3f61d76bafd430a2b1..53857b8ddbc1a85c3e564dd04fbf403ba02f230b 100644 (file)
@@ -40,7 +40,7 @@ class glpiSelectUser extends plugin
     plugin::execute();
 
     if(isset($_POST['depselect'])){
-      $_SESSION['glpi_user_filter']['base'] = $_POST['depselect'];
+      session::set('glpi_user_filter', array('base' => $_POST['depselect']));
     }
 
     $filter  = session::get('glpi_user_filter');
@@ -150,7 +150,8 @@ class glpiSelectUser extends plugin
 
     
     /* Get all departments within this subtree */
-    $this->base = $_SESSION['glpi_user_filter']['base'];
+    $glpi_user_filter = session::get('glpi_user_filter');
+    $this->base = $glpi_user_filter['base'];
     $options  ="";
     $base = $this->config->current['BASE'];
     $deps= get_list("(&(|(ou=*)(description=*))(objectClass=gosaDepartment))", "users", $base,
index 2e69a849deaebabb0beebbb5bfdae8a7ca79b353..c95c6b7334c3562fa069f7d9b4f71bb18383c78f 100644 (file)
@@ -148,7 +148,9 @@ class goFonServer extends goService{
 
       /* Updated config list of gofon servers */
       if($this->orig_dn == "new" || $this->orig_dn != $this->dn){
-        $_SESSION['config']->load_servers();
+        $config = session::get('config');
+        $config->load_servers();
+        session::set('config',$config);
       }
     }
   }
index a6f2146e20ac4758be0cc6414ee7081aa9cb6d93..ab7f48e363c31e396ab5f61574b07d72114f2ab4 100644 (file)
@@ -29,8 +29,9 @@ if ($remove_lock){
   /* Create usermanagement object on demand */
   if (!session::is_set('userManagement') ||
      (isset($_GET['reset']) && $_GET['reset'] == 1)){
-    $_SESSION['userManagement']= new userManagement ($config, $_SESSION['ui']);
-    $_SESSION['userManagement']->set_acl_category("users");
+    $userManagement= new userManagement ($config, session::get('ui'));
+    $userManagement->set_acl_category("users");
+    session::set('userManagement',$userManagement);
   }
   $userManagement = session::get('userManagement');
   $userManagement->save_object();
index 71e362cdbf8a7665b8e32aee8ca8fd9140365f8b..2f0fd686353968602b8400f65bf828fd78655842 100644 (file)
@@ -8,8 +8,9 @@ if ($remove_lock){
 } else {
        /* Create blocklist object on demand */
        if (!session::is_set('blocklist') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['blocklist']= new blocklist($config, $ui);
-               $_SESSION['blocklist']->set_acl_category("gofaxlist");
+               $blocklist= new blocklist($config, $ui);
+               $blocklist->set_acl_category("gofaxlist");
+               session::set('blocklist',$blocklist);
        }
        $blocklist = session::get('blocklist');
        $blocklist->save_object();
index 356781eae28a7e95e958c52cf66d3e6f6b638b9b..28c308ce8a16dc2395863ffe9d9ad63096ccc9f7 100644 (file)
@@ -67,7 +67,9 @@ class gofaxAccount extends plugin
      * Added to be able to handle department selection in divSelelect
      */
     if(!session::is_set("Fax_Filter")){
-      $_SESSION['Fax_Filter']['depselect'] = $this->config->current['BASE'];
+      $Fax_Filter = array();
+      $Fax_Filter['depselect'] = $this->config->current['BASE'];
+      session::set('Fax_Filter',$Fax_Filter);
     }
 
     if ($dn != "new"){
@@ -125,11 +127,13 @@ class gofaxAccount extends plugin
      */
     if((isset($_GET['act']))&&($_GET['act']=="dep_open")){
 
+      $Fax_Filter = session::get('Fax_Filter');
       if(strlen(base64_decode($_GET['dep_id']))>= strlen($this->config->current['BASE'])){
-        $_SESSION['Fax_Filter']['depselect']= base64_decode($_GET['dep_id']);
+        $Fax_Filter['depselect']= base64_decode($_GET['dep_id']);
       }else{
-        $_SESSION['Fax_Filter']['depselect']= $this->config->current['BASE'];
+        $Fax_Filter['depselect']= $this->config->current['BASE'];
       }
+      session::set('Fax_Filter',$Fax_Filter);
     }
 
     /* Edit mode specifies if we are editing from my accout */
@@ -413,7 +417,8 @@ class gofaxAccount extends plugin
       /* The base specifies the current position in the ldap tree 
        * The current base was specified by $_GET['dep_id'] before. Or contains the default value.
        */
-      $base = $_SESSION['Fax_Filter']['depselect'];
+      $Fax_Filter = session::get('Fax_Filter');
+      $base = $Fax_Filter['depselect'];
       $ldap->cd($base);
 
       /* Ge all Blocklists */
@@ -441,7 +446,8 @@ class gofaxAccount extends plugin
       $this->departments= array();
    
       /* Get all departments within the current department */ 
-      $base = $_SESSION['Fax_Filter']['depselect'];
+      $Fax_Filter = session::get('Fax_Filter');
+      $base = $Fax_Filter['depselect'];
       $ldap->ls("(objectClass=gosaDepartment)",$base);
 
       /* Base back is used to go one department up in our ldap tree */
@@ -501,7 +507,8 @@ class gofaxAccount extends plugin
       /* The base specifies the current position in the ldap tree
        * The current base was specified by $_GET['dep_id'] before. Or contains the default value.
        */
-      $base = $_SESSION['Fax_Filter']['depselect'];
+      $Fax_Filter = session::get('Fax_Filter');
+      $base = $Fax_Filter['depselect'];
       $ldap->cd($base);
 
       /* Ge all Blocklists */ 
index a9d45caeed6e9a8a268cfe98aff9e7075ea17912..fb9aef32051498f6c231b1e58e4327cfbcf3a711 100644 (file)
@@ -16,10 +16,10 @@ if (!$remove_lock){
 
        /* Create gofaxAccount object on demand */
        if (!session::is_set('gofaxAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['gofaxAccount']= new gofaxAccount ($config, $ui->dn);
-               $_SESSION['gofaxAccount']->set_acl_base($ui->dn);
-               $_SESSION['gofaxAccount']->set_acl_category("users");
-
+               $gofaxAccount= new gofaxAccount ($config, $ui->dn);
+               $gofaxAccount->set_acl_base($ui->dn);
+               $gofaxAccount->set_acl_category("users");
+               session::set('gofaxAccount',$gofaxAccount);
        }
        $gofaxAccount = session::get('gofaxAccount');
 
index 53b915ee719a442aa58d0ff479d6d668e02de4af..80054352422a165a3899ee99a5694ab6f9c2c01b 100644 (file)
@@ -198,7 +198,7 @@ class faxreport extends plugin
       $queuing_time= $line['queuing_time'];
 
       /* The user is allowed to download all fax images from those users 
-          that are listed in $_SESSION['fuserfilter'] 
+          that are listed in session::get('fuserfilter') 
          Don't forget to check getfax.php if you change somthing here */
       session::set('fuserfilter',$this->userfilter);
       $smarty->assign("plug", "?plug=".validate($_GET['plug']));
@@ -425,7 +425,7 @@ class faxreport extends plugin
   }
 
 
-  /* Save ui input, and store it in $_SESSION 
+  /* Save ui input, and store it in session::get() 
      to remember last search next time*/
   function save_object()
   {
index 58ca227c2c9a1286e771efb4ef8b48e4138308ad..03bf95b41acdbc4e42607daa68b54e5d04299b76 100644 (file)
@@ -3,7 +3,7 @@
 if (!$remove_lock){
        /* Create faxreport object on demand */
        if (!session::is_set('faxreport') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['faxreport']= new faxreport ($config, $ui);
+               session::set('faxreport',new faxreport ($config, $ui));
        }
        $faxreport = session::get('faxreport');
 
index 51194a30ba44a1fcaa733be9d0b7cb3a8447b143..cd6c84aa93aa5f2f38cf6f4aa25de35281e74197 100644 (file)
@@ -81,15 +81,11 @@ class conference extends plugin
      *  and use first server as default if necessary.
      */
     $a_SETUP= array();
-    if(array_key_exists('config',$_SESSION) &&
-       array_key_exists('SERVERS',$_SESSION['config']->data) &&
-       array_key_exists('FON',$_SESSION['config']->data['SERVERS']) &&
-       count($_SESSION['config']->data['SERVERS']['FON']) &&
-       is_callable("mysql_connect")
-       ) {
+    $config = session::get('config');
+    if(isset($config->data['SERVERS']['FON']) && is_callable("mysql_connect")) {
 
       /* Set available server */
-      $this->goFonHomeServers = $_SESSION['config']->data['SERVERS']['FON'];
+      $this->goFonHomeServers = $config->data['SERVERS']['FON'];
 
       /* Set default server */
       if($this->dn == "new"){
index 7eb54057ccaf1da11c57bd9bd868db4e3a7c7a26..54293d992d9156e827defc59d5aa0f1797dcc152 100644 (file)
@@ -28,7 +28,7 @@ if ($remove_lock){
 } else {
        /* Create usermanagement object on demand */
        if (!session::is_set('conference') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['conference']= new phoneConferenceManagment($config, $ui);
+               session::set("conference",new phoneConferenceManagment($config, $ui));
        }
        $conference = session::get('conference');
        $conference->save_object();
index 54abef0fc07d4f0e84a91422da32724ddc097c61..0b3d25f5e99ae0d40201a0b5670705a15307d2fb 100644 (file)
@@ -3,7 +3,7 @@
 if (!$remove_lock){
        /* Create fonreport object on demand */
        if (!session::is_set('fonreport') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['fonreport']= new fonreport ($config, $ui);
+               session::set('fonreport',new fonreport ($config, $ui));
        }
        $fonreport = session::get('fonreport');
 
index 1b5992cc532ed16db19a32c8d3fc6b2f571ea7fd..f4ed4a8bae2c9074b178e52f2355397680da6e83 100755 (executable)
@@ -75,13 +75,10 @@ class macro extends plugin
      * Load all server configuration in $this->goFonHomeServers if available
      */
     $a_SETUP= array();
-    if(array_key_exists('config',$_SESSION) &&
-       array_key_exists('SERVERS',$_SESSION['config']->data) &&
-       count($_SESSION['config']->data['SERVERS']['FON']) && 
-       array_key_exists('FON',$_SESSION['config']->data['SERVERS'])) {
+    if(isset($config->data['SERVERS']['FON'])){
 
       /* Set available server */
-      $this->goFonHomeServers = $_SESSION['config']->data['SERVERS']['FON'];
+      $this->goFonHomeServers = $config->data['SERVERS']['FON'];
   
       /* Remove default entry, not necessary here */
       if(isset($this->goFonHomeServers[0])){
index 5a08d3e228aa56e240f03c94a3f18612d6f5d5fd..935321e0fe4777a4e74cdcf2ee98c850af88dfc5 100755 (executable)
@@ -188,8 +188,9 @@ class macroParameter extends plugin
          so we use the acls from gofon/marco */
     $ACLs = $this->ui->get_permissions($this->dn,"gofonmacro/macro","goFonMarcoContent");
 
-    /* get current content */ 
-    $content = $_SESSION['macroManagment']->macrotabs->by_object['macro']->goFonMacroContent;
+    /* get current content */
+    $macroManagment = session::get('macroManagment') ;
+    $content = $macroManagment->macrotabs->by_object['macro']->goFonMacroContent;
 
     if(strstr($content,"ARG")){
       $vorpos = strpos($content,"ARG");
index a508abd9b5f5e0bd58edea9af19c8a40acd3c468..106c3db735d68cd416196c8f2998b9783904f125 100755 (executable)
@@ -29,7 +29,7 @@ if ($remove_lock){
 
   /* Create macroManagment object on demand */
   if (!session::is_set('macroManagment') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-    $_SESSION['macroManagment']= new goFonMacro ($config, $_SESSION['ui']);
+    session::set('macroManagment',new goFonMacro ($config, session::get('ui')));
   }
 
   /* Get object */
index fbc3f65af96c184200a48f8bc6ebda557a6a7311..687399f2ff3e34ac50d26d9f911e100e4c848161 100644 (file)
@@ -32,9 +32,10 @@ if (!$remove_lock){
 
        /* Create phoneAccount object on demand */
        if (!session::is_set('phoneAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-               $_SESSION['phoneAccount']= new phoneAccount ($config, $ui->dn);
-               $_SESSION['phoneAccount']->set_acl_base($ui->dn);
-               $_SESSION['phoneAccount']->set_acl_category("users");
+               $phoneAccount= new phoneAccount ($config, $ui->dn);
+               $phoneAccount->set_acl_base($ui->dn);
+               $phoneAccount->set_acl_category("users");
+               session::set('phoneAccount',$phoneAccount);
        }
        $phoneAccount = session::get('phoneAccount');
 
index b30822bc65d5bfbf133eb9e48629a58fbf1e3a6e..2e00ce96e7de340ca70665d8ab1e2540c556565a 100644 (file)
@@ -20,7 +20,7 @@
 
 /* Create a new setup class if necessary  */
 if (!session::is_set('setup') || (isset($_GET['reset']) && $_GET['reset'] == 1)){
-  $_SESSION['setup']= new setup ();
+  session::set('setup',new setup());
 }
 $setup = session::get('setup');