From 02bd61f90052ba951b0824e09456d9d9587274ec Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Jan 2008 08:09:36 +0000 Subject: [PATCH] Some additional session changes git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8206 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/class_MultiSelectWindow.inc | 15 +++++++++------ gosa-core/include/class_config.inc | 2 +- gosa-core/include/class_divlist.inc | 4 ++-- gosa-core/include/class_msg_dialog.inc | 14 ++++++++------ gosa-core/include/class_userinfo.inc | 12 +++++++----- gosa-core/include/functions.inc | 8 ++++---- gosa-core/include/functions_FAI.inc | 10 ++++++---- gosa-core/include/functions_helpviewer.inc | 2 +- gosa-core/include/smarty/plugins/block.render.php | 2 +- .../plugins/addons/logview/class_gosa_logview.inc | 5 +++-- gosa-core/plugins/addons/logview/main.inc | 2 +- .../applications/class_applicationGeneric.inc | 7 ++++--- .../admin/applications/tabs_application.inc | 5 +++-- .../admin/mimetypes/class_mimetypeGeneric.inc | 7 +++++-- .../plugins/admin/mimetypes/tabs_mimetypes.inc | 6 ++++-- .../plugins/admin/systems/class_printGeneric.inc | 3 ++- .../admin/systems/class_systemManagement.inc | 7 ++++--- .../admin/systems/class_workstationService.inc | 3 ++- .../admin/systems/class_workstationStartup.inc | 7 ++++--- .../admin/systems/ppd/class_printerPPDDialog.inc | 5 +++-- .../services/glpi/class_glpiSelectUser.inc | 2 +- .../gofax/faxaccount/class_gofaxAccount.inc | 2 +- gosa-core/plugins/gofax/faxaccount/main.inc | 4 ++-- .../gofon/phoneaccount/class_phoneAccount.inc | 11 +++++------ gosa-core/plugins/gofon/phoneaccount/main.inc | 4 ++-- gosa-core/plugins/personal/connectivity/main.inc | 4 ++-- gosa-core/plugins/personal/environment/main.inc | 2 +- gosa-core/plugins/personal/generic/main.inc | 6 +++--- gosa-core/plugins/personal/mail/main.inc | 4 ++-- gosa-core/plugins/personal/nagios/main.inc | 4 ++-- gosa-core/plugins/personal/netatalk/main.inc | 8 ++++---- gosa-core/plugins/personal/posix/main.inc | 4 ++-- gosa-core/plugins/personal/samba/main.inc | 4 ++-- gosa-core/plugins/personal/scalix/main.inc | 4 ++-- 34 files changed, 105 insertions(+), 84 deletions(-) diff --git a/gosa-core/include/class_MultiSelectWindow.inc b/gosa-core/include/class_MultiSelectWindow.inc index bbdc5920d..e32eb158c 100644 --- a/gosa-core/include/class_MultiSelectWindow.inc +++ b/gosa-core/include/class_MultiSelectWindow.inc @@ -62,8 +62,9 @@ class MultiSelectWindow{ /* Check if the given input field name was already used for this type of dialog */ - if(isset($_SESSION['MultiDialogFilters'][$this->filterName][$name])){ - $arr['value'] = $_SESSION['MultiDialogFilters'][$this->filterName][$name]; + $MultiDialogFilters = session::get('MultiDialogFilters'); + if(isset($MultiDialogFilters[$this->filterName][$name])){ + $arr['value'] = $MultiDialogFilters[$this->filterName][$name]; $this->$name = $arr['value']; }else{ $arr['value'] = $value; @@ -116,9 +117,10 @@ class MultiSelectWindow{ $this->selectedBase = $_SESSION['CurrentMainBase']; /* Check default values for SaveAdditionalVars */ + $MultiDialogFilters = session::get('MultiDialogFilters'); foreach($this->SaveAdditionalVars as $name){ - if(isset($_SESSION['MultiDialogFilters'][$this->filterName][$name])){ - $this->$name = $_SESSION['MultiDialogFilters'][$this->filterName][$name]; + if(isset($MultiDialogFilters[$this->filterName][$name])){ + $this->$name = $MultiDialogFilters[$this->filterName][$name]; } } @@ -254,8 +256,9 @@ class MultiSelectWindow{ }else{ /* Check if there was already a variable for this dialog which we should use instead of the default*/ - if(isset($_SESSION['MultiDialogFilters'][$this->filterName][$name])){ - $arr['default'] = $_SESSION['MultiDialogFilters'][$this->filterName][$name]; + $MultiDialogFilters = session::get('MultiDialogFilters'); + if(isset($MultiDialogFilters[$this->filterName][$name])){ + $arr['default'] = $MultiDialogFilters[$this->filterName][$name]; $this->$name = $arr['default']; }else{ $arr['default'] = $default; diff --git a/gosa-core/include/class_config.inc b/gosa-core/include/class_config.inc index 0b4b92eb6..8cb002d9e 100644 --- a/gosa-core/include/class_config.inc +++ b/gosa-core/include/class_config.inc @@ -225,7 +225,7 @@ class config { display_error_page(); } - if (!isset($_SESSION['size_limit'])){ + if (!session::is_set('size_limit')){ session::set('size_limit',$this->current['SIZELIMIT']); session::set('size_ignore',$this->current['SIZEIGNORE']); } diff --git a/gosa-core/include/class_divlist.inc b/gosa-core/include/class_divlist.inc index 9c52b768c..0ed9f2520 100644 --- a/gosa-core/include/class_divlist.inc +++ b/gosa-core/include/class_divlist.inc @@ -204,8 +204,8 @@ class divlist { $_SESSION['start'.$this->pageid]=$_GET['start']; $start = $_GET['start']; } else { - if(isset($_SESSION['start'.$this->pageid])){ - $start = $_SESSION['start'.$this->pageid]; + if(session::is_set('start'.$this->pageid)){ + $start = session::get('start'.$this->pageid); } else { $start=0; } diff --git a/gosa-core/include/class_msg_dialog.inc b/gosa-core/include/class_msg_dialog.inc index efd6cab05..8c3851808 100644 --- a/gosa-core/include/class_msg_dialog.inc +++ b/gosa-core/include/class_msg_dialog.inc @@ -27,12 +27,13 @@ class msg_dialog session::set('errorsAlreadyPosted',array()); } - if(!isset($_SESSION['errorsAlreadyPosted'][$s_title.$s_message])){ - $_SESSION['errorsAlreadyPosted'][$s_title.$s_message] = 0; + $errorsAlreadyPosted = session::get('errorsAlreadyPosted'); + if(!isset($errorsAlreadyPosted[$s_title.$s_message])){ + $errorsAlreadyPosted[$s_title.$s_message] = 0; } - $_SESSION['errorsAlreadyPosted'][$s_title.$s_message]++; + $errorsAlreadyPosted[$s_title.$s_message]++; - if($_SESSION['errorsAlreadyPosted'][$s_title.$s_message] <=1 ){ + if($errorsAlreadyPosted[$s_title.$s_message] <=1 ){ $this->i_ID = preg_replace("/[^0-9]*/","",microtime()); $this->s_Title = $s_title; @@ -46,7 +47,7 @@ class msg_dialog preg_match("/^true$/i",$config->data['MAIN']['DISPLAYERRORS'])){ $this->a_Trace = debug_backtrace(); } - if(!isset($_SESSION['msg_dialogs'])){ + if(!session::is_set('msg_dialogs')){ session::set('msg_dialogs',array()); } if($this->i_Type == FATAL_ERROR_DIALOG){ @@ -57,6 +58,7 @@ class msg_dialog $_SESSION['msg_dialogs'][] = $this; } } + session::set('errorsAlreadyPosted',$errorsAlreadyPosted); } public static function display($s_title,$s_message,$i_type = INFO_DIALOG) @@ -125,7 +127,7 @@ class msg_dialog # $seen = $_POST['closed_msg_dialogs']; } - if(isset($_SESSION['msg_dialogs']) && is_array($_SESSION['msg_dialogs']) && count($_SESSION['msg_dialogs'])){ + if(session::is_set('msg_dialogs') && is_array($_SESSION['msg_dialogs']) && count($_SESSION['msg_dialogs'])){ /* Get frame one */ $smarty = get_smarty(); diff --git a/gosa-core/include/class_userinfo.inc b/gosa-core/include/class_userinfo.inc index 77015dad2..50ea8b169 100644 --- a/gosa-core/include/class_userinfo.inc +++ b/gosa-core/include/class_userinfo.inc @@ -190,13 +190,14 @@ class userinfo function get_permissions($dn, $object, $attribute= "", $skip_write= FALSE) { /* Push cache answer? */ - if (isset($_SESSION['ACL_CACHE']["$dn+$object+$attribute"])){ + $ACL_CACHE = session::get('ACL_CACHE'); + if (isset($ACL_CACHE["$dn+$object+$attribute"])){ /* Remove write if needed */ if ($skip_write){ - $ret = preg_replace('/w/', '', $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]); + $ret = preg_replace('/w/', '', $ACL_CACHE["$dn+$object+$attribute"]); }else{ - $ret = $_SESSION['ACL_CACHE']["$dn+$object+$attribute"]; + $ret = $ACL_CACHE["$dn+$object+$attribute"]; } return($ret); } @@ -288,8 +289,9 @@ class userinfo function get_module_departments($module) { /* Use cached results if possilbe */ - if(isset($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)])){ - return($_SESSION['ACL_CACHE']['MODULE_DEPARTMENTS'][serialize($module)]); + $ACL_CACHE = session::get('ACL_CACHE'); + if(isset($ACL_CACHE['MODULE_DEPARTMENTS'][serialize($module)])){ + return($ACL_CACHE['MODULE_DEPARTMENTS'][serialize($module)]); } global $plist; diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index 6937598f2..1b90b7487 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -1539,19 +1539,19 @@ function print_header($image, $headline, $info= "") function register_global($name, $object) { - $_SESSION[$name]= $object; + session::set($name,$object); } function is_global($name) { - return isset($_SESSION[$name]); + return(session::is_set($name)); } -function &get_global($name) +function get_global($name) { - return $_SESSION[$name]; + return(session::get($name)); } diff --git a/gosa-core/include/functions_FAI.inc b/gosa-core/include/functions_FAI.inc index 92a350e4d..e4e7314ff 100644 --- a/gosa-core/include/functions_FAI.inc +++ b/gosa-core/include/functions_FAI.inc @@ -214,16 +214,18 @@ function save_release_changes_now() $to_save = array(); /* check which objects must be saved */ - foreach($_SESSION['FAI_objects_to_save'] as $Current_DN => $object){ + $FAI_objects_to_save = session::get('FAI_objects_to_save'); + foreach($FAI_objects_to_save as $Current_DN => $object){ if($object['diff']){ $sub_name = $Current_DN; - while(isset($_SESSION['FAI_objects_to_save'][$sub_name])){ - $to_save[strlen($sub_name)][$sub_name] = $_SESSION['FAI_objects_to_save'][$sub_name]; - unset($_SESSION['FAI_objects_to_save'][$sub_name]); + while(isset($FAI_objects_to_save[$sub_name])){ + $to_save[strlen($sub_name)][$sub_name] = $FAI_objects_to_save[$sub_name]; + unset($FAI_objects_to_save[$sub_name]); $sub_name = preg_replace('/^[^,]+,/', '', $sub_name); } } } + session::set('FAI_objects_to_save',$FAI_objects_to_save); /* Sort list of objects that must be saved, and ensure that container objects are safed, before their childs are saved */ diff --git a/gosa-core/include/functions_helpviewer.inc b/gosa-core/include/functions_helpviewer.inc index 1339332ac..ce7a7f45b 100644 --- a/gosa-core/include/functions_helpviewer.inc +++ b/gosa-core/include/functions_helpviewer.inc @@ -271,7 +271,7 @@ function search($arr,$word) $tryword = ""; // Temporary searchword handling $result['global']['maxhit'] = 0; session::un_set('lastresults'); - unset($_SESSION['parsed_search_keyword']); + session::un_set('parsed_search_keyword'); session::set('parsed_search_keyword',""); error_reporting(E_ALL | E_STRICT); diff --git a/gosa-core/include/smarty/plugins/block.render.php b/gosa-core/include/smarty/plugins/block.render.php index e58e9ad1a..7b06754c3 100755 --- a/gosa-core/include/smarty/plugins/block.render.php +++ b/gosa-core/include/smarty/plugins/block.render.php @@ -14,7 +14,7 @@ function smarty_block_render($params, $text, &$smarty) } /* Debug output */ - if (isset($_SESSION['DEBUGLEVEL']) && $_SESSION['DEBUGLEVEL'] & DEBUG_ACL ){ + if (session::is_set('DEBUGLEVEL') && session::get('DEBUGLEVEL') & DEBUG_ACL ){ echo " ".$acl.""; } diff --git a/gosa-core/plugins/addons/logview/class_gosa_logview.inc b/gosa-core/plugins/addons/logview/class_gosa_logview.inc index 87d234a4d..05be42da3 100644 --- a/gosa-core/plugins/addons/logview/class_gosa_logview.inc +++ b/gosa-core/plugins/addons/logview/class_gosa_logview.inc @@ -35,9 +35,10 @@ class gosa_logview extends plugin $this->ui = get_userinfo(); /* Restore last filter settings */ + $logview = session::get('logview'); foreach(array("action","server","time","regex") as $attr){ - if(isset($_SESSION['logview']['gosa_log'][$attr])){ - $this->$attr = $_SESSION['logview']['gosa_log'][$attr]; + if(isset($logview['gosa_log'][$attr])){ + $this->$attr = $logview['gosa_log'][$attr]; } } diff --git a/gosa-core/plugins/addons/logview/main.inc b/gosa-core/plugins/addons/logview/main.inc index f6767de94..218d7ad0a 100644 --- a/gosa-core/plugins/addons/logview/main.inc +++ b/gosa-core/plugins/addons/logview/main.inc @@ -20,7 +20,7 @@ if (!$remove_lock){ /* Create logview object on demand */ - if (!isset($_SESSION['log_tabs']) || (isset($_GET['reset']) && $_GET['reset'] == 1)){ + if (!session::is_set('log_tabs') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ $_SESSION['log_tabs']= new log_tabs($config, $config->data['TABS']['LOGTABS'],""); } $log_tabs= $_SESSION['log_tabs']; diff --git a/gosa-core/plugins/admin/applications/class_applicationGeneric.inc b/gosa-core/plugins/admin/applications/class_applicationGeneric.inc index 95e5145a1..6427dbd8d 100644 --- a/gosa-core/plugins/admin/applications/class_applicationGeneric.inc +++ b/gosa-core/plugins/admin/applications/class_applicationGeneric.inc @@ -411,9 +411,10 @@ class application extends plugin $ldap->cd($this->config->current["BASE"]); $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs')); - if((!empty($tmp)) && (isset($_SESSION['appfilter']['release']))){ - $baseDn = str_replace($this->config->current['BASE'],$this->base,$_SESSION['appfilter']['release']); - $baseDn = preg_replace("/".get_ou('applicationou').".*/",get_ou('applicationou').$this->base,$_SESSION['appfilter']['release']); + $appfilter = session::get('appfilter'); + if((!empty($tmp)) && (isset($appfilter['release']))){ + $baseDn = str_replace($this->config->current['BASE'],$this->base,$appfilter['release']); + $baseDn = preg_replace("/".get_ou('applicationou').".*/",get_ou('applicationou').$this->base,$appfilter['release']); $ldap->ls("(&(objectClass=gosaApplication)(cn=".$this->cn."))",$baseDn,array("cn")); if($ldap->count()){ $attrs = $ldap->fetch(); diff --git a/gosa-core/plugins/admin/applications/tabs_application.inc b/gosa-core/plugins/admin/applications/tabs_application.inc index 1683c5ef0..23d2f39ad 100644 --- a/gosa-core/plugins/admin/applications/tabs_application.inc +++ b/gosa-core/plugins/admin/applications/tabs_application.inc @@ -27,11 +27,12 @@ class apptabs extends tabs /* Check for new 'dn', in order to propagate the 'dn' to all plugins */ $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs')); - if((!empty($tmp)) && (isset($_SESSION['appfilter']['release']))){ + $appfilter = session::get('appfilter'); + if((!empty($tmp)) && (isset($appfilter['release']))){ if(!$baseobject->isReleaseApplikation){ $new_dn= "cn=".$baseobject->cn.",".get_ou('applicationou').$baseobject->base; }else{ - $new_dn ="cn=".$baseobject->cn.",".$_SESSION['appfilter']['release']; + $new_dn ="cn=".$baseobject->cn.",".$appfilter['release']; } }else{ $new_dn= "cn=".$baseobject->cn.",".get_ou('applicationou').$baseobject->base; diff --git a/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc index 05f868070..67d383873 100644 --- a/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -133,7 +133,7 @@ class mimetype extends plugin /* Set base */ if ($this->dn == "new"){ if(session::is_set('CurrentMainBase')){ - $this->base= $_SESSION['CurrentMainBase']; + $this->base= session::get('CurrentMainBase'); }else{ $ui= get_userinfo(); $this->base= dn2base($ui->dn); @@ -537,7 +537,10 @@ class mimetype extends plugin /* Check if there is already a mime type with this cn */ $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current["BASE"]); - if($this->isReleaseMimeType && (isset($_SESSION['mimefilter']['release']))){ + + $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']); $ldap->ls("(&(objectClass=gotoMimeType)(cn=".$this->cn."))",$baseDn,array("cn")); diff --git a/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc b/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc index e8f53d32e..9e93bb411 100755 --- a/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc +++ b/gosa-core/plugins/admin/mimetypes/tabs_mimetypes.inc @@ -28,11 +28,13 @@ class mimetabs extends tabs 'dn' to all plugins */ $tmp = $this->config->search("faiManagement", "CLASS",array('menu','tabs')); - if((!empty($tmp)) && (isset($_SESSION['mimefilter']['release']))){ + $mimefilter = session::get('mimefilter'); + + if((!empty($tmp)) && (isset($mimefilter['release']))){ if(!$baseobject->isReleaseMimeType){ $new_dn= "cn=".$baseobject->cn.",".get_ou('mimetypeou').$baseobject->base; }else{ - $new_dn ="cn=".$baseobject->cn.",".$_SESSION['mimefilter']['release']; + $new_dn ="cn=".$baseobject->cn.",".$mimefilter['release']; } }else{ $new_dn= "cn=".$baseobject->cn.",".get_ou('mimetypeou').$baseobject->base; diff --git a/gosa-core/plugins/admin/systems/class_printGeneric.inc b/gosa-core/plugins/admin/systems/class_printGeneric.inc index effcfc029..6761f2f88 100644 --- a/gosa-core/plugins/admin/systems/class_printGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_printGeneric.inc @@ -502,7 +502,8 @@ class printgeneric extends plugin } /* Parse selected ppd file */ - if((isset($_SESSION['config']->data['MAIN']['PPD_PATH']))&&(is_dir($_SESSION['config']->data['MAIN']['PPD_PATH']))){ + $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']; if(!preg_match("/\/$/",$path)){ diff --git a/gosa-core/plugins/admin/systems/class_systemManagement.inc b/gosa-core/plugins/admin/systems/class_systemManagement.inc index 8b2bcc94b..bcbd9b5f1 100644 --- a/gosa-core/plugins/admin/systems/class_systemManagement.inc +++ b/gosa-core/plugins/admin/systems/class_systemManagement.inc @@ -766,7 +766,8 @@ class systems extends plugin } /* Save terminal data to ldap */ - if(isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){ + $SelectedSystemType = session::get('SelectedSystemType'); + if(isset($SelectedSystemType['ogroup']) && $SelectedSystemType['ogroup'] != 'none'){ foreach (array("workservice", "termservice") as $cls){ if (isset($this->systab->by_object[$cls])){ $this->systab->by_object[$cls]->gotoXMouseport= ""; @@ -780,7 +781,7 @@ class systems extends plugin $this->systab->save(); if(session::is_set('SelectedSystemType')){ - unset($_SESSION['SelectedSystemType']); + session::un_set('SelectedSystemType'); if(!isset($ldap)){ $ldap = $this->config->get_ldap_link(); } @@ -824,7 +825,7 @@ class systems extends plugin /* Remove ogroup selection, which was set while editing a new incoming entry */ if(session::is_set('SelectedSystemType')){ - unset($_SESSION['SelectedSystemType']); + session::un_set('SelectedSystemType'); } } diff --git a/gosa-core/plugins/admin/systems/class_workstationService.inc b/gosa-core/plugins/admin/systems/class_workstationService.inc index 23698cf61..526b9cc17 100644 --- a/gosa-core/plugins/admin/systems/class_workstationService.inc +++ b/gosa-core/plugins/admin/systems/class_workstationService.inc @@ -222,7 +222,8 @@ class workservice extends plugin } /* Workaround to fill in inherited values if we've specified an objectclass */ - if (isset($_SESSION['SelectedSystemType']['ogroup']) && $_SESSION['SelectedSystemType']['ogroup'] != 'none'){ + $SelectedSystemType = $SelectedSystemType; + if (isset($SelectedSystemType['ogroup']) && $SelectedSystemType['ogroup'] != 'none'){ $this->XResolutions= array('default' => _("inherited")); $this->XColordepths= array('default' => _("inherited")); $this->XKbModels= array('default' => _("inherited")); diff --git a/gosa-core/plugins/admin/systems/class_workstationStartup.inc b/gosa-core/plugins/admin/systems/class_workstationStartup.inc index 371966801..457acc4f4 100644 --- a/gosa-core/plugins/admin/systems/class_workstationStartup.inc +++ b/gosa-core/plugins/admin/systems/class_workstationStartup.inc @@ -426,8 +426,9 @@ class workstartup extends plugin /* There could be more than one server providing this release, so use cached result if available */ - if(isset($_SESSION['getAvailableClassesForThisRelease_CACHE'][$release])) { - return($_SESSION['getAvailableClassesForThisRelease_CACHE'][$release]); + $getAvailableClassesForThisRelease_CACHE = session::get('getAvailableClassesForThisRelease_CACHE'); + if(isset($getAvailableClassesForThisRelease_CACHE[$release])) { + return($getAvailableClassesForThisRelease_CACHE[$release]); } $test2 = array(); @@ -436,7 +437,7 @@ class workstartup extends plugin $ldap = $this->config->get_ldap_link(); $ldap->cd($this->config->current['BASE']); - /* Get classes fpr given release */ + /* Get classes for given release */ $p_classes = get_all_objects_for_given_base($bb, "(|(objectClass=FAIpackageList)(objectClass=FAItemplate)". "(objectClass=FAIvariable)(objectClass=FAIscript)(objectClass=FAIhook)". diff --git a/gosa-core/plugins/admin/systems/ppd/class_printerPPDDialog.inc b/gosa-core/plugins/admin/systems/ppd/class_printerPPDDialog.inc index a93e91bb4..49f668180 100644 --- a/gosa-core/plugins/admin/systems/ppd/class_printerPPDDialog.inc +++ b/gosa-core/plugins/admin/systems/ppd/class_printerPPDDialog.inc @@ -39,8 +39,9 @@ class printerPPDDialog extends plugin $this->depselect = $this->config->current['BASE']; /* Get PPD path and remove double //, and add trailing / */ - if(isset($_SESSION['config']->data['MAIN']['PPD_PATH'])){ - $this->pathToPPD = $_SESSION['config']->data['MAIN']['PPD_PATH']; + $config = session::get('config'); + if(isset($config->data['MAIN']['PPD_PATH'])){ + $this->pathToPPD = $config->data['MAIN']['PPD_PATH']; $this->pathToPPD= preg_replace("/\/\//", "/", $this->pathToPPD); if(!preg_match("/\/$/",$this->pathToPPD)){ $this->pathToPPD = $this->pathToPPD."/"; diff --git a/gosa-core/plugins/admin/systems/services/glpi/class_glpiSelectUser.inc b/gosa-core/plugins/admin/systems/services/glpi/class_glpiSelectUser.inc index 7b580df31..1356557e4 100644 --- a/gosa-core/plugins/admin/systems/services/glpi/class_glpiSelectUser.inc +++ b/gosa-core/plugins/admin/systems/services/glpi/class_glpiSelectUser.inc @@ -25,7 +25,7 @@ class glpiSelectUser extends plugin $this->PostVarName = $postvar; - if(!isset($_SESSION['glpi_user_filter'])){ + if(!session::is_set('glpi_user_filter')){ $tmp['users_regex'] = "*"; $tmp['base'] = $this->config->current['BASE']; session::set('glpi_user_filter',$tmp); diff --git a/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc b/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc index 087ae83c8..356781eae 100644 --- a/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc +++ b/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc @@ -66,7 +66,7 @@ class gofaxAccount extends plugin /* Hickert : 11.11.05 * Added to be able to handle department selection in divSelelect */ - if(!isset($_SESSION["Fax_Filter"])){ + if(!session::is_set("Fax_Filter")){ $_SESSION['Fax_Filter']['depselect'] = $this->config->current['BASE']; } diff --git a/gosa-core/plugins/gofax/faxaccount/main.inc b/gosa-core/plugins/gofax/faxaccount/main.inc index 26cdd6e1b..9c3389f4a 100644 --- a/gosa-core/plugins/gofax/faxaccount/main.inc +++ b/gosa-core/plugins/gofax/faxaccount/main.inc @@ -24,7 +24,7 @@ if (!$remove_lock){ $gofaxAccount= $_SESSION['gofaxAccount']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $gofaxAccount->save_object (); } @@ -74,7 +74,7 @@ if (!$remove_lock){ $info= ""; /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('gofaxAccount',$gofaxAccount); } diff --git a/gosa-core/plugins/gofon/phoneaccount/class_phoneAccount.inc b/gosa-core/plugins/gofon/phoneaccount/class_phoneAccount.inc index 97bf0f27d..84c0e037e 100644 --- a/gosa-core/plugins/gofon/phoneaccount/class_phoneAccount.inc +++ b/gosa-core/plugins/gofon/phoneaccount/class_phoneAccount.inc @@ -84,15 +84,14 @@ class phoneAccount extends plugin /* Set available server */ - if(isset($_SESSION['config']->data['SERVERS']['FON'])){ - $this->goFonHomeServers = $_SESSION['config']->data['SERVERS']['FON']; + $config = session::get('config'); + if(isset($config->data['SERVERS']['FON'])){ + $this->goFonHomeServers = $config->data['SERVERS']['FON']; } $a_SETUP= array(); - if($this->is_account && - array_key_exists('config',$_SESSION) && - array_key_exists('SERVERS',$_SESSION['config']->data) && - array_key_exists('FON',$_SESSION['config']->data['SERVERS']) && + if($this->is_account && isset($config->data['SERVERS']['FON']) && + array_key_exists('FON',$config->data['SERVERS']) && is_callable("mysql_connect") ) { diff --git a/gosa-core/plugins/gofon/phoneaccount/main.inc b/gosa-core/plugins/gofon/phoneaccount/main.inc index fd5f7d994..90c44943a 100644 --- a/gosa-core/plugins/gofon/phoneaccount/main.inc +++ b/gosa-core/plugins/gofon/phoneaccount/main.inc @@ -39,7 +39,7 @@ if (!$remove_lock){ $phoneAccount= $_SESSION['phoneAccount']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $phoneAccount->save_object (); } @@ -91,7 +91,7 @@ if (!$remove_lock){ } /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('phoneAccount',$phoneAccount); } diff --git a/gosa-core/plugins/personal/connectivity/main.inc b/gosa-core/plugins/personal/connectivity/main.inc index 16b66c13e..8f72a142a 100644 --- a/gosa-core/plugins/personal/connectivity/main.inc +++ b/gosa-core/plugins/personal/connectivity/main.inc @@ -45,7 +45,7 @@ if (!$remove_lock){ $connectivity= $_SESSION['connectivity']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $connectivity->save_object (); } @@ -90,7 +90,7 @@ if (!$remove_lock){ $display= $connectivity->execute (); /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('connectivity',$connectivity); } diff --git a/gosa-core/plugins/personal/environment/main.inc b/gosa-core/plugins/personal/environment/main.inc index 7142f96e7..cb2fb6b4d 100644 --- a/gosa-core/plugins/personal/environment/main.inc +++ b/gosa-core/plugins/personal/environment/main.inc @@ -87,7 +87,7 @@ if (!$remove_lock){ } /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('environment',$environment); } diff --git a/gosa-core/plugins/personal/generic/main.inc b/gosa-core/plugins/personal/generic/main.inc index 556cfe8ec..8d72c9fd1 100644 --- a/gosa-core/plugins/personal/generic/main.inc +++ b/gosa-core/plugins/personal/generic/main.inc @@ -41,12 +41,12 @@ if (!$remove_lock){ $user= $_SESSION['user']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $user->save_object (); } /* Enter edit mode? */ - if ((isset($_POST['edit'])) && (!isset( $_SESSION['edit'])) &&preg_match("/w/",$ui->get_permissions($ui->dn,"users/user"))){ + if ((isset($_POST['edit'])) && (!session::is_set('edit')) &&preg_match("/w/",$ui->get_permissions($ui->dn,"users/user"))){ /* Check locking */ if (($username= get_lock($ui->dn)) != ""){ @@ -143,7 +143,7 @@ if (!$remove_lock){ } /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('user',$user); } diff --git a/gosa-core/plugins/personal/mail/main.inc b/gosa-core/plugins/personal/mail/main.inc index 8c63ae181..e92e3b0ce 100644 --- a/gosa-core/plugins/personal/mail/main.inc +++ b/gosa-core/plugins/personal/mail/main.inc @@ -39,7 +39,7 @@ if (!$remove_lock){ $mailAccount= $_SESSION['mailAccount']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $mailAccount->save_object (); } @@ -89,7 +89,7 @@ if (!$remove_lock){ } /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('mailAccount',$mailAccount); } diff --git a/gosa-core/plugins/personal/nagios/main.inc b/gosa-core/plugins/personal/nagios/main.inc index 3bc236915..3d30664cb 100644 --- a/gosa-core/plugins/personal/nagios/main.inc +++ b/gosa-core/plugins/personal/nagios/main.inc @@ -40,7 +40,7 @@ if (!$remove_lock){ $nagiosAccount= $_SESSION['nagiosAccount']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $nagiosAccount->save_object (); } @@ -90,7 +90,7 @@ if (!$remove_lock){ } /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('nagiosAccount',$nagiosAccount); } diff --git a/gosa-core/plugins/personal/netatalk/main.inc b/gosa-core/plugins/personal/netatalk/main.inc index bb03aa918..2fca342da 100644 --- a/gosa-core/plugins/personal/netatalk/main.inc +++ b/gosa-core/plugins/personal/netatalk/main.inc @@ -28,7 +28,7 @@ if (!$remove_lock) { } /* Create netatalk object on demand */ - if (!isset ($_SESSION['netatalk']) || (isset ($_GET['reset']) && $_GET['reset'] == 1)) { + if (!session::is_set('netatalk') || (isset ($_GET['reset']) && $_GET['reset'] == 1)) { $_SESSION['netatalk'] = new netatalk($config, $ui->dn); $_SESSION['netatalk']->enable_CSN_check(); $_SESSION['netatalk']->set_acl_base($ui->dn); @@ -37,7 +37,7 @@ if (!$remove_lock) { $netatalk = $_SESSION['netatalk']; /* save changes back to object */ - if (isset ($_SESSION['edit'])) { + if (session::is_set('edit')) { $netatalk->save_object(); } @@ -81,7 +81,7 @@ if (!$remove_lock) { $display = $netatalk->execute(); /* Store changes in session */ - if (isset ($_SESSION['edit'])) { + if (session::is_set('edit')) { session::set('netatalk',$netatalk); } @@ -91,7 +91,7 @@ if (!$remove_lock) { $display .= "

"; /* Are we in edit mode? */ - if (isset ($_SESSION['edit'])) { + if (session::is_set('edit')) { $display .= "\n"; $display .= " "; $display .= "\n"; diff --git a/gosa-core/plugins/personal/posix/main.inc b/gosa-core/plugins/personal/posix/main.inc index 44c8c401f..571e88ba0 100644 --- a/gosa-core/plugins/personal/posix/main.inc +++ b/gosa-core/plugins/personal/posix/main.inc @@ -40,7 +40,7 @@ if (!$remove_lock){ $posixAccount= $_SESSION['posixAccount']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $posixAccount->save_object (); } @@ -91,7 +91,7 @@ if (!$remove_lock){ } /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('posixAccount',$posixAccount); } diff --git a/gosa-core/plugins/personal/samba/main.inc b/gosa-core/plugins/personal/samba/main.inc index be3354ce3..83e44cf20 100644 --- a/gosa-core/plugins/personal/samba/main.inc +++ b/gosa-core/plugins/personal/samba/main.inc @@ -40,7 +40,7 @@ if (!$remove_lock){ $sambaAccount= $_SESSION['sambaAccount']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $sambaAccount->save_object (); } @@ -90,7 +90,7 @@ if (!$remove_lock){ } /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('sambaAccount',$sambaAccount); } diff --git a/gosa-core/plugins/personal/scalix/main.inc b/gosa-core/plugins/personal/scalix/main.inc index abfd65a45..3b913efe3 100644 --- a/gosa-core/plugins/personal/scalix/main.inc +++ b/gosa-core/plugins/personal/scalix/main.inc @@ -38,7 +38,7 @@ if (!$remove_lock){ $scalixAccount= $_SESSION['scalixAccount']; /* save changes back to object */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ $scalixAccount->save_object (); } @@ -86,7 +86,7 @@ if (!$remove_lock){ $display= $scalixAccount->execute (); /* Store changes in session */ - if (isset ($_SESSION['edit'])){ + if (session::is_set('edit')){ session::set('scalixAccount',$scalixAccount); } -- 2.30.2