From: hickert Date: Fri, 4 Jan 2008 10:04:04 +0000 (+0000) Subject: Some additional Session fixes. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=42219fa478e91ed1ba3d6b41c9b7988bcb4ec66f;p=gosa.git Some additional Session fixes. - Only /plugins/admin/fai/ isn't fixed yet git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8211 594d385d-05f5-0310-b6e9-bd551577e9d8 --- diff --git a/gosa-core/plugins/addons/godfs/main.inc b/gosa-core/plugins/addons/godfs/main.inc index 6e15fe929..4ade21848 100644 --- a/gosa-core/plugins/addons/godfs/main.inc +++ b/gosa-core/plugins/addons/godfs/main.inc @@ -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"), "\"\" ".$_SESSION['objectinfo']); + "\"> ".session::get('objectinfo')); } else { $display = print_header(get_template_path('images/dfs.png'), _("Distributed File System Administration")); diff --git a/gosa-core/plugins/addons/gotomasses/main.inc b/gosa-core/plugins/addons/gotomasses/main.inc index f83100d15..7a517fecd 100644 --- a/gosa-core/plugins/addons/gotomasses/main.inc +++ b/gosa-core/plugins/addons/gotomasses/main.inc @@ -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'); diff --git a/gosa-core/plugins/addons/ldapmanager/main.inc b/gosa-core/plugins/addons/ldapmanager/main.inc index bef58098e..c1d0b9d7c 100644 --- a/gosa-core/plugins/addons/ldapmanager/main.inc +++ b/gosa-core/plugins/addons/ldapmanager/main.inc @@ -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'); diff --git a/gosa-core/plugins/addons/logview/class_gosa_logview.inc b/gosa-core/plugins/addons/logview/class_gosa_logview.inc index 05be42da3..2ad6e9348 100644 --- a/gosa-core/plugins/addons/logview/class_gosa_logview.inc +++ b/gosa-core/plugins/addons/logview/class_gosa_logview.inc @@ -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); } } diff --git a/gosa-core/plugins/addons/logview/main.inc b/gosa-core/plugins/addons/logview/main.inc index 7cea93586..5df3535ec 100644 --- a/gosa-core/plugins/addons/logview/main.inc +++ b/gosa-core/plugins/addons/logview/main.inc @@ -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'); diff --git a/gosa-core/plugins/addons/mailqueue/main.inc b/gosa-core/plugins/addons/mailqueue/main.inc index eba85f1da..2e0f274d0 100644 --- a/gosa-core/plugins/addons/mailqueue/main.inc +++ b/gosa-core/plugins/addons/mailqueue/main.inc @@ -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'); diff --git a/gosa-core/plugins/addons/notifications/main.inc b/gosa-core/plugins/addons/notifications/main.inc index 00c0cdae4..fa90571d0 100644 --- a/gosa-core/plugins/addons/notifications/main.inc +++ b/gosa-core/plugins/addons/notifications/main.inc @@ -19,18 +19,19 @@ */ 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 */ diff --git a/gosa-core/plugins/admin/acl/main.inc b/gosa-core/plugins/admin/acl/main.inc index 87dc4299b..abdbb3451 100644 --- a/gosa-core/plugins/admin/acl/main.inc +++ b/gosa-core/plugins/admin/acl/main.inc @@ -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'); diff --git a/gosa-core/plugins/admin/applications/class_applicationGeneric.inc b/gosa-core/plugins/admin/applications/class_applicationGeneric.inc index e150b0622..daa97d637 100644 --- a/gosa-core/plugins/admin/applications/class_applicationGeneric.inc +++ b/gosa-core/plugins/admin/applications/class_applicationGeneric.inc @@ -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; } } diff --git a/gosa-core/plugins/admin/applications/class_divListApplication.inc b/gosa-core/plugins/admin/applications/class_divListApplication.inc index 8177d5129..f70d5c618 100755 --- a/gosa-core/plugins/admin/applications/class_divListApplication.inc +++ b/gosa-core/plugins/admin/applications/class_divListApplication.inc @@ -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); } } diff --git a/gosa-core/plugins/admin/applications/main.inc b/gosa-core/plugins/admin/applications/main.inc index b5152b89c..4595ef7c2 100644 --- a/gosa-core/plugins/admin/applications/main.inc +++ b/gosa-core/plugins/admin/applications/main.inc @@ -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(); diff --git a/gosa-core/plugins/admin/departments/class_departmentManagement.inc b/gosa-core/plugins/admin/departments/class_departmentManagement.inc index 5eef20099..c8577edb2 100644 --- a/gosa-core/plugins/admin/departments/class_departmentManagement.inc +++ b/gosa-core/plugins/admin/departments/class_departmentManagement.inc @@ -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])){ diff --git a/gosa-core/plugins/admin/departments/main.inc b/gosa-core/plugins/admin/departments/main.inc index 6f94c64f7..c53038453 100644 --- a/gosa-core/plugins/admin/departments/main.inc +++ b/gosa-core/plugins/admin/departments/main.inc @@ -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'); diff --git a/gosa-core/plugins/admin/devices/class_deviceManagement.inc b/gosa-core/plugins/admin/devices/class_deviceManagement.inc index d66e15c39..77c582575 100644 --- a/gosa-core/plugins/admin/devices/class_deviceManagement.inc +++ b/gosa-core/plugins/admin/devices/class_deviceManagement.inc @@ -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 diff --git a/gosa-core/plugins/admin/devices/main.inc b/gosa-core/plugins/admin/devices/main.inc index 115971c00..51cf4d6a2 100755 --- a/gosa-core/plugins/admin/devices/main.inc +++ b/gosa-core/plugins/admin/devices/main.inc @@ -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 */ diff --git a/gosa-core/plugins/admin/groups/class_groupGeneric.inc b/gosa-core/plugins/admin/groups/class_groupGeneric.inc index 9da0acb1e..1d9007401 100644 --- a/gosa-core/plugins/admin/groups/class_groupGeneric.inc +++ b/gosa-core/plugins/admin/groups/class_groupGeneric.inc @@ -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')){ diff --git a/gosa-core/plugins/admin/groups/main.inc b/gosa-core/plugins/admin/groups/main.inc index 23976c113..e86d46c92 100644 --- a/gosa-core/plugins/admin/groups/main.inc +++ b/gosa-core/plugins/admin/groups/main.inc @@ -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(); diff --git a/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc b/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc index c9426f75c..da73758aa 100755 --- a/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc +++ b/gosa-core/plugins/admin/mimetypes/class_divListMimeTypes.inc @@ -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); } } diff --git a/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc b/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc index 67d383873..1895e163a 100644 --- a/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc +++ b/gosa-core/plugins/admin/mimetypes/class_mimetypeGeneric.inc @@ -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(); diff --git a/gosa-core/plugins/admin/mimetypes/main.inc b/gosa-core/plugins/admin/mimetypes/main.inc index 5f37b1b75..36059d99e 100755 --- a/gosa-core/plugins/admin/mimetypes/main.inc +++ b/gosa-core/plugins/admin/mimetypes/main.inc @@ -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 */ diff --git a/gosa-core/plugins/admin/ogroups/class_phonequeue.inc b/gosa-core/plugins/admin/ogroups/class_phonequeue.inc index f67ee78d8..2a5cfb6a6 100644 --- a/gosa-core/plugins/admin/ogroups/class_phonequeue.inc +++ b/gosa-core/plugins/admin/ogroups/class_phonequeue.inc @@ -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"){ diff --git a/gosa-core/plugins/admin/ogroups/main.inc b/gosa-core/plugins/admin/ogroups/main.inc index 4172b4165..18c8fde19 100644 --- a/gosa-core/plugins/admin/ogroups/main.inc +++ b/gosa-core/plugins/admin/ogroups/main.inc @@ -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'); diff --git a/gosa-core/plugins/admin/systems/class_printGeneric.inc b/gosa-core/plugins/admin/systems/class_printGeneric.inc index f289b4dc0..3020e0d5a 100644 --- a/gosa-core/plugins/admin/systems/class_printGeneric.inc +++ b/gosa-core/plugins/admin/systems/class_printGeneric.inc @@ -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."/"; } diff --git a/gosa-core/plugins/admin/systems/class_systemManagement.inc b/gosa-core/plugins/admin/systems/class_systemManagement.inc index 7d052d207..73a64aec9 100644 --- a/gosa-core/plugins/admin/systems/class_systemManagement.inc +++ b/gosa-core/plugins/admin/systems/class_systemManagement.inc @@ -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 diff --git a/gosa-core/plugins/admin/systems/class_workstationStartup.inc b/gosa-core/plugins/admin/systems/class_workstationStartup.inc index aec2da2ae..be1aad21d 100644 --- a/gosa-core/plugins/admin/systems/class_workstationStartup.inc +++ b/gosa-core/plugins/admin/systems/class_workstationStartup.inc @@ -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); } diff --git a/gosa-core/plugins/admin/systems/main.inc b/gosa-core/plugins/admin/systems/main.inc index e2b0f6f23..987937748 100644 --- a/gosa-core/plugins/admin/systems/main.inc +++ b/gosa-core/plugins/admin/systems/main.inc @@ -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(); diff --git a/gosa-core/plugins/admin/systems/ppd/class_printerPPDSelectionDialog.inc b/gosa-core/plugins/admin/systems/ppd/class_printerPPDSelectionDialog.inc index 450da9347..ee5813062 100644 --- a/gosa-core/plugins/admin/systems/ppd/class_printerPPDSelectionDialog.inc +++ b/gosa-core/plugins/admin/systems/ppd/class_printerPPDSelectionDialog.inc @@ -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 */ diff --git a/gosa-core/plugins/admin/systems/services/dns/class_termDNS.inc b/gosa-core/plugins/admin/systems/services/dns/class_termDNS.inc index 025933291..f64650f26 100644 --- a/gosa-core/plugins/admin/systems/services/dns/class_termDNS.inc +++ b/gosa-core/plugins/admin/systems/services/dns/class_termDNS.inc @@ -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"); diff --git a/gosa-core/plugins/admin/systems/services/glpi/class_glpiAttachmentPool.inc b/gosa-core/plugins/admin/systems/services/glpi/class_glpiAttachmentPool.inc index d315cebf8..df2bae08d 100644 --- a/gosa-core/plugins/admin/systems/services/glpi/class_glpiAttachmentPool.inc +++ b/gosa-core/plugins/admin/systems/services/glpi/class_glpiAttachmentPool.inc @@ -261,6 +261,8 @@ class glpiAttachmentPool extends plugin name='new_attach' alt='"._("New Attachment"). "'> ". ""; + $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); 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 5b0ec6708..53857b8dd 100644 --- a/gosa-core/plugins/admin/systems/services/glpi/class_glpiSelectUser.inc +++ b/gosa-core/plugins/admin/systems/services/glpi/class_glpiSelectUser.inc @@ -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, diff --git a/gosa-core/plugins/admin/systems/services/gofon/class_goFonServer.inc b/gosa-core/plugins/admin/systems/services/gofon/class_goFonServer.inc index 2e69a849d..c95c6b733 100644 --- a/gosa-core/plugins/admin/systems/services/gofon/class_goFonServer.inc +++ b/gosa-core/plugins/admin/systems/services/gofon/class_goFonServer.inc @@ -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); } } } diff --git a/gosa-core/plugins/admin/users/main.inc b/gosa-core/plugins/admin/users/main.inc index a6f2146e2..ab7f48e36 100644 --- a/gosa-core/plugins/admin/users/main.inc +++ b/gosa-core/plugins/admin/users/main.inc @@ -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(); diff --git a/gosa-core/plugins/gofax/blocklists/main.inc b/gosa-core/plugins/gofax/blocklists/main.inc index 71e362cdb..2f0fd6863 100644 --- a/gosa-core/plugins/gofax/blocklists/main.inc +++ b/gosa-core/plugins/gofax/blocklists/main.inc @@ -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(); diff --git a/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc b/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc index 356781eae..28c308ce8 100644 --- a/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc +++ b/gosa-core/plugins/gofax/faxaccount/class_gofaxAccount.inc @@ -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 */ diff --git a/gosa-core/plugins/gofax/faxaccount/main.inc b/gosa-core/plugins/gofax/faxaccount/main.inc index a9d45caee..fb9aef320 100644 --- a/gosa-core/plugins/gofax/faxaccount/main.inc +++ b/gosa-core/plugins/gofax/faxaccount/main.inc @@ -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'); diff --git a/gosa-core/plugins/gofax/faxreports/class_faxreport.inc b/gosa-core/plugins/gofax/faxreports/class_faxreport.inc index 53b915ee7..800543524 100644 --- a/gosa-core/plugins/gofax/faxreports/class_faxreport.inc +++ b/gosa-core/plugins/gofax/faxreports/class_faxreport.inc @@ -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() { diff --git a/gosa-core/plugins/gofax/faxreports/main.inc b/gosa-core/plugins/gofax/faxreports/main.inc index 58ca227c2..03bf95b41 100644 --- a/gosa-core/plugins/gofax/faxreports/main.inc +++ b/gosa-core/plugins/gofax/faxreports/main.inc @@ -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'); diff --git a/gosa-core/plugins/gofon/conference/class_phoneConferenceGeneric.inc b/gosa-core/plugins/gofon/conference/class_phoneConferenceGeneric.inc index 51194a30b..cd6c84aa9 100644 --- a/gosa-core/plugins/gofon/conference/class_phoneConferenceGeneric.inc +++ b/gosa-core/plugins/gofon/conference/class_phoneConferenceGeneric.inc @@ -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"){ diff --git a/gosa-core/plugins/gofon/conference/main.inc b/gosa-core/plugins/gofon/conference/main.inc index 7eb54057c..54293d992 100644 --- a/gosa-core/plugins/gofon/conference/main.inc +++ b/gosa-core/plugins/gofon/conference/main.inc @@ -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(); diff --git a/gosa-core/plugins/gofon/fonreports/main.inc b/gosa-core/plugins/gofon/fonreports/main.inc index 54abef0fc..0b3d25f5e 100644 --- a/gosa-core/plugins/gofon/fonreports/main.inc +++ b/gosa-core/plugins/gofon/fonreports/main.inc @@ -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'); diff --git a/gosa-core/plugins/gofon/macro/class_gofonMacro.inc b/gosa-core/plugins/gofon/macro/class_gofonMacro.inc index 1b5992cc5..f4ed4a8ba 100755 --- a/gosa-core/plugins/gofon/macro/class_gofonMacro.inc +++ b/gosa-core/plugins/gofon/macro/class_gofonMacro.inc @@ -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])){ diff --git a/gosa-core/plugins/gofon/macro/class_gofonMacroParameters.inc b/gosa-core/plugins/gofon/macro/class_gofonMacroParameters.inc index 5a08d3e22..935321e0f 100755 --- a/gosa-core/plugins/gofon/macro/class_gofonMacroParameters.inc +++ b/gosa-core/plugins/gofon/macro/class_gofonMacroParameters.inc @@ -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"); diff --git a/gosa-core/plugins/gofon/macro/main.inc b/gosa-core/plugins/gofon/macro/main.inc index a508abd9b..106c3db73 100755 --- a/gosa-core/plugins/gofon/macro/main.inc +++ b/gosa-core/plugins/gofon/macro/main.inc @@ -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 */ diff --git a/gosa-core/plugins/gofon/phoneaccount/main.inc b/gosa-core/plugins/gofon/phoneaccount/main.inc index fbc3f65af..687399f2f 100644 --- a/gosa-core/plugins/gofon/phoneaccount/main.inc +++ b/gosa-core/plugins/gofon/phoneaccount/main.inc @@ -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'); diff --git a/gosa-core/setup/main.inc b/gosa-core/setup/main.inc index b30822bc6..2e00ce96e 100644 --- a/gosa-core/setup/main.inc +++ b/gosa-core/setup/main.inc @@ -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');