From 4bc4cd8dc753c0efafa2961e8a4216463645cd13 Mon Sep 17 00:00:00 2001 From: hickert Date: Fri, 4 Jan 2008 08:38:21 +0000 Subject: [PATCH] Fixed Session calls in user plugins git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@8208 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/plugins/personal/connectivity/main.inc | 15 ++++++++------- gosa-core/plugins/personal/environment/main.inc | 9 +++++---- gosa-core/plugins/personal/generic/class_user.inc | 8 +++++--- gosa-core/plugins/personal/generic/main.inc | 9 +++++---- gosa-core/plugins/personal/mail/main.inc | 9 +++++---- gosa-core/plugins/personal/nagios/main.inc | 9 +++++---- gosa-core/plugins/personal/netatalk/main.inc | 9 +++++---- gosa-core/plugins/personal/password/main.inc | 2 +- .../plugins/personal/posix/class_posixAccount.inc | 2 +- gosa-core/plugins/personal/posix/main.inc | 9 +++++---- gosa-core/plugins/personal/samba/main.inc | 9 +++++---- gosa-core/plugins/personal/scalix/main.inc | 9 +++++---- 12 files changed, 55 insertions(+), 44 deletions(-) diff --git a/gosa-core/plugins/personal/connectivity/main.inc b/gosa-core/plugins/personal/connectivity/main.inc index 585a4628b..4de04fcf5 100644 --- a/gosa-core/plugins/personal/connectivity/main.inc +++ b/gosa-core/plugins/personal/connectivity/main.inc @@ -31,16 +31,17 @@ if (!$remove_lock){ /* Create connectivity object on demand */ if (!session::is_set('connectivity') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['connectivity']= new connectivity ($config, $ui->dn); - $_SESSION['connectivity']->enable_CSN_check(); - $_SESSION['connectivity']->set_acl_base($ui->dn); - $_SESSION['connectivity']->set_acl_category("users"); + $connectivity= new connectivity ($config, $ui->dn); + $connectivity->enable_CSN_check(); + $connectivity->set_acl_base($ui->dn); + $connectivity->set_acl_category("users"); /* Adjust acl's to mode */ - foreach ($_SESSION['connectivity']->plugin_name as $name){ - $_SESSION['connectivity']->plugin[$name]->set_acl_category( "users"); - $_SESSION['connectivity']->plugin[$name]->set_acl_base($ui->dn); + foreach ($connectivity->plugin_name as $name){ + $connectivity->plugin[$name]->set_acl_category( "users"); + $connectivity->plugin[$name]->set_acl_base($ui->dn); } + session::set('connectivity',$connectivity); } $connectivity = session::get('connectivity'); diff --git a/gosa-core/plugins/personal/environment/main.inc b/gosa-core/plugins/personal/environment/main.inc index 415e49124..d6b7021ce 100644 --- a/gosa-core/plugins/personal/environment/main.inc +++ b/gosa-core/plugins/personal/environment/main.inc @@ -29,10 +29,11 @@ if (!$remove_lock){ /* Create mail object on demand */ if (!session::is_set('environment') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['environment']= new environment ($config, $ui->dn); - $_SESSION['environment']->enable_CSN_check(); - $_SESSION['environment']->set_acl_category('users'); - $_SESSION['environment']->set_acl_base($ui->dn); + $environment= new environment ($config, $ui->dn); + $environment->enable_CSN_check(); + $environment->set_acl_category('users'); + $environment->set_acl_base($ui->dn); + session::set('environment',$environment); } $environment = session::get('environment'); diff --git a/gosa-core/plugins/personal/generic/class_user.inc b/gosa-core/plugins/personal/generic/class_user.inc index ff26df46f..15f8921c7 100644 --- a/gosa-core/plugins/personal/generic/class_user.inc +++ b/gosa-core/plugins/personal/generic/class_user.inc @@ -674,7 +674,7 @@ class user extends plugin } /* If needed, let the password method do some cleanup */ - $tmp = new passwordMethod($_SESSION['config']); + $tmp = new passwordMethod($this->config); $available = $tmp->get_available_methods(); if (in_array_ics($this->pw_storage, $available['name'])){ $test= new $available[$this->pw_storage]($this->config); @@ -979,7 +979,9 @@ class user extends plugin $this->cleanup(); if(isset($this->attrs['preferredLanguage'])){ - $_SESSION['ui']->language = $this->preferredLanguage; + $ui = session::get('ui'); + $ui->language = $this->preferredLanguage; + session::set('ui',$ui); session::set('Last_init_lang',"update"); } @@ -1034,7 +1036,7 @@ class user extends plugin /* If needed, let the password method do some cleanup */ if ($this->pw_storage != $this->last_pw_storage){ - $tmp = new passwordMethod($_SESSION['config']); + $tmp = new passwordMethod($this->config); $available = $tmp->get_available_methods(); if (in_array_ics($this->last_pw_storage, $available['name'])){ $test= new $available[$this->last_pw_storage]($this->config,$this->dn); diff --git a/gosa-core/plugins/personal/generic/main.inc b/gosa-core/plugins/personal/generic/main.inc index 752bffafe..508d27441 100644 --- a/gosa-core/plugins/personal/generic/main.inc +++ b/gosa-core/plugins/personal/generic/main.inc @@ -33,10 +33,11 @@ if (!$remove_lock){ /* Create user object on demand */ if (!session::is_set('user') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['user']= new user ($config, $ui->dn); - $_SESSION['user']->enable_CSN_check(); - $_SESSION['user']->set_acl_base($ui->dn); - $_SESSION['user']->set_acl_category("users"); + $user= new user ($config, $ui->dn); + $user->enable_CSN_check(); + $user->set_acl_base($ui->dn); + $user->set_acl_category("users"); + session::set('user',$user); } $user = session::get('user'); diff --git a/gosa-core/plugins/personal/mail/main.inc b/gosa-core/plugins/personal/mail/main.inc index 267dbb1f4..ea37ea22e 100644 --- a/gosa-core/plugins/personal/mail/main.inc +++ b/gosa-core/plugins/personal/mail/main.inc @@ -31,10 +31,11 @@ if (!$remove_lock){ /* Create mail object on demand */ if (!session::is_set('mailAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['mailAccount']= new mailAccount ($config, $ui->dn); - $_SESSION['mailAccount']->enable_CSN_check(); - $_SESSION['mailAccount']->set_acl_base($ui->dn); - $_SESSION['mailAccount']->set_acl_category("users"); + $mailAccount= new mailAccount ($config, $ui->dn); + $mailAccount->enable_CSN_check(); + $mailAccount->set_acl_base($ui->dn); + $mailAccount->set_acl_category("users"); + session::set('mailAccount',$mailAccount); } $mailAccount = session::get('mailAccount'); diff --git a/gosa-core/plugins/personal/nagios/main.inc b/gosa-core/plugins/personal/nagios/main.inc index 6b486e3d5..dc4be7c53 100644 --- a/gosa-core/plugins/personal/nagios/main.inc +++ b/gosa-core/plugins/personal/nagios/main.inc @@ -32,10 +32,11 @@ if (!$remove_lock){ /* Create mail object on demand */ if (!session::is_set('nagiosAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['nagiosAccount']= new nagiosAccount ($config, $ui->dn); - $_SESSION['nagiosAccount']->enable_CSN_check(); - $_SESSION['nagiosAccount']->set_acl_base($ui->dn); - $_SESSION['nagiosAccount']->set_acl_category("users"); + $nagiosAccount= new nagiosAccount ($config, $ui->dn); + $nagiosAccount->enable_CSN_check(); + $nagiosAccount->set_acl_base($ui->dn); + $nagiosAccount->set_acl_category("users"); + session::set('nagiosAccount',$nagiosAccount); } $nagiosAccount = session::get('nagiosAccount'); diff --git a/gosa-core/plugins/personal/netatalk/main.inc b/gosa-core/plugins/personal/netatalk/main.inc index 6e2585920..a73cd7bce 100644 --- a/gosa-core/plugins/personal/netatalk/main.inc +++ b/gosa-core/plugins/personal/netatalk/main.inc @@ -29,10 +29,11 @@ if (!$remove_lock) { /* Create netatalk object on demand */ 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); - $_SESSION['netatalk']->set_acl_category("users"); + $netatalk = new netatalk($config, $ui->dn); + $netatalk->enable_CSN_check(); + $netatalk->set_acl_base($ui->dn); + $netatalk->set_acl_category("users"); + session::set('netatalk',$netatalk); } $netatalk = session::get('netatalk'); diff --git a/gosa-core/plugins/personal/password/main.inc b/gosa-core/plugins/personal/password/main.inc index cfdc8f69b..37ce0593e 100644 --- a/gosa-core/plugins/personal/password/main.inc +++ b/gosa-core/plugins/personal/password/main.inc @@ -34,7 +34,7 @@ if (!$remove_lock){ /* Create password object on demand */ if (!session::is_set('password') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['password']= new password ($config, $ui->dn); + session::set('password', new password ($config, $ui->dn)); } $password = session::get('password'); diff --git a/gosa-core/plugins/personal/posix/class_posixAccount.inc b/gosa-core/plugins/personal/posix/class_posixAccount.inc index a12c53c52..a836759b3 100644 --- a/gosa-core/plugins/personal/posix/class_posixAccount.inc +++ b/gosa-core/plugins/personal/posix/class_posixAccount.inc @@ -426,7 +426,7 @@ class posixAccount extends plugin $smarty->assign("tree_image", get_template_path('images/tree.png')); $smarty->assign("deplist", $this->config->idepartments); $smarty->assign("alphabet", generate_alphabet()); - $smarty->assign("depselect",$_SESSION['CurrentMainBase']); + $smarty->assign("depselect", session::get('CurrentMainBase')); $smarty->assign("hint", print_sizelimit_warning()); $smarty->assign("apply", apply_filter()); diff --git a/gosa-core/plugins/personal/posix/main.inc b/gosa-core/plugins/personal/posix/main.inc index a83757c31..eb111d17b 100644 --- a/gosa-core/plugins/personal/posix/main.inc +++ b/gosa-core/plugins/personal/posix/main.inc @@ -32,10 +32,11 @@ if (!$remove_lock){ /* Create posixAccount object on demand */ if (!session::is_set('posixAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['posixAccount']= new posixAccount ($config, $ui->dn); - $_SESSION['posixAccount']->enable_CSN_check(); - $_SESSION['posixAccount']->set_acl_base($ui->dn); - $_SESSION['posixAccount']->set_acl_category("users"); + $posixAccount= new posixAccount ($config, $ui->dn); + $posixAccount->enable_CSN_check(); + $posixAccount->set_acl_base($ui->dn); + $posixAccount->set_acl_category("users"); + session::set('posixAccount',$posixAccount); } $posixAccount = session::get('posixAccount'); diff --git a/gosa-core/plugins/personal/samba/main.inc b/gosa-core/plugins/personal/samba/main.inc index e37c8128b..0d983df96 100644 --- a/gosa-core/plugins/personal/samba/main.inc +++ b/gosa-core/plugins/personal/samba/main.inc @@ -32,10 +32,11 @@ if (!$remove_lock){ /* Create sambaAccount object on demand */ if (!session::is_set('sambaAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['sambaAccount']= new sambaAccount ($config, $ui->dn); - $_SESSION['sambaAccount']->enable_CSN_check(); - $_SESSION['sambaAccount']->set_acl_base($ui->dn); - $_SESSION['sambaAccount']->set_acl_category("users"); + $sambaAccount= new sambaAccount ($config, $ui->dn); + $sambaAccount->enable_CSN_check(); + $sambaAccount->set_acl_base($ui->dn); + $sambaAccount->set_acl_category("users"); + session::set('sambaAccount',$sambaAccount); } $sambaAccount = session::get('sambaAccount'); diff --git a/gosa-core/plugins/personal/scalix/main.inc b/gosa-core/plugins/personal/scalix/main.inc index d0532a257..afcc1e9b4 100644 --- a/gosa-core/plugins/personal/scalix/main.inc +++ b/gosa-core/plugins/personal/scalix/main.inc @@ -30,10 +30,11 @@ if (!$remove_lock){ /* Create mail object on demand */ if (!session::is_set('scalixAccount') || (isset($_GET['reset']) && $_GET['reset'] == 1)){ - $_SESSION['scalixAccount']= new scalixAccount ($config, $ui->dn); - $_SESSION['scalixAccount']->enable_CSN_check(); - $_SESSION['scalixAccount']->set_acl_base($ui->dn); - $_SESSION['scalixAccount']->set_acl_category("users"); + $scalixAccount= new scalixAccount ($config, $ui->dn); + $scalixAccount->enable_CSN_check(); + $scalixAccount->set_acl_base($ui->dn); + $scalixAccount->set_acl_category("users"); + session::set('scalixAccount',$scalixAccount); } $scalixAccount = session::get('scalixAccount'); -- 2.30.2