]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Improve stability by replace framework session calls to raw PHP sessions
authorMarcin Haba <marcin.haba@bacula.pl>
Sun, 28 Sep 2014 08:46:24 +0000 (10:46 +0200)
committerMarcin Haba <marcin.haba@bacula.pl>
Sun, 28 Sep 2014 08:57:52 +0000 (10:57 +0200)
gui/baculum/protected/Class/BaculumPage.php
gui/baculum/protected/Pages/ConfigurationWizard.php
gui/baculum/protected/Portlets/ClientList.php
gui/baculum/protected/Portlets/JobList.php
gui/baculum/protected/Portlets/JobRunList.php
gui/baculum/protected/Portlets/PoolList.php
gui/baculum/protected/Portlets/Portlets.php
gui/baculum/protected/Portlets/SlideWindow.php
gui/baculum/protected/Portlets/StorageList.php
gui/baculum/protected/Portlets/VolumeList.php
gui/baculum/protected/application.xml

index 1c9bcd3773a6a939935e8f8dfc9f100158043fa0..1ad9ed6e5190fda86ec97fd740b71e645fc45966 100644 (file)
@@ -28,11 +28,11 @@ class BaculumPage extends TPage
        }
 
        public function getLanguage() {
-               if(isset($this->Session['language']) && !empty($this->Session['language'])) {
-                       $language =  $this->Session['language'];
+               if(isset($_SESSION['language']) && !empty($_SESSION['language'])) {
+                       $language =  $_SESSION['language'];
                } else {
                        $language = $this->getModule('configuration')->getLanguage();
-                       $this->Session['language'] = $language;
+                       $_SESSION['language'] = $language;
                }
                return $language;
        }
index 7c0be6720d8a446315f6d78d4afc9ef7b7f0c9c1..84ea1bad63b68800f8591505c34e5683348c8fda 100644 (file)
@@ -38,7 +38,7 @@ class ConfigurationWizard extends BaculumPage
 
        public function onInit($param) {
                parent::onInit($param);
-               $this->Lang->SelectedValue = $this->Session['language'];
+               $this->Lang->SelectedValue = $_SESSION['language'];
                $this->firstRun = !$this->getModule('configuration')->isApplicationConfig();
                $this->applicationConfig = $this->getModule('configuration')->getApplicationConfig();
                if($this->firstRun === false && $this->User->getIsAdmin() === false) {
@@ -175,7 +175,7 @@ class ConfigurationWizard extends BaculumPage
        }
 
        public function setLang($sender, $param) {
-               $this->Session['language'] = $sender->SelectedValue;
+               $_SESSION['language'] = $sender->SelectedValue;
                $this->goToPage('ConfigurationWizard');
        }
 
index 5d3d5dadda0248747de2e2d76800a17662eb1782..021c7a10b639f8e0042f77fbf194614fb59381bc 100644 (file)
@@ -40,7 +40,7 @@ class ClientList extends Portlets {
                        if(in_array($this->getPage()->CallBackEventTarget->ID, $allowedButtons) || $forceReload) {\r
                                $params = $this->getUrlParams('clients', $this->getPage()->ClientWindow->ID);\r
                                $clients = $this->Application->getModule('api')->get($params);\r
-                               $isDetailView = $this->Session['view' . $this->getPage()->ClientWindow->ID] == 'details';\r
+                               $isDetailView = $_SESSION['view' . $this->getPage()->ClientWindow->ID] == 'details';\r
                                $clientsList = $this->Application->getModule('misc')->objectToArray($clients->output);\r
                                $this->RepeaterShow->Visible = !$isDetailView;\r
                                $this->Repeater->DataSource = $isDetailView === false ? $clientsList : array();\r
index d84bda5b1deaebff4d1a271cbd211a7b3b111a19..3ce0091d6ed543275cff4f17e7e7b1230a37262c 100644 (file)
@@ -85,7 +85,7 @@ class JobList extends Portlets {
                        if(in_array($this->getPage()->CallBackEventTarget->ID, $allowedButtons) || $forceReload) {\r
                                $params = $this->getUrlParams('jobs', $this->getPage()->JobWindow->ID);\r
                                $jobs = $this->Application->getModule('api')->get($params);\r
-                               $isDetailView = $this->Session['view' . $this->getPage()->JobWindow->ID] == 'details';\r
+                               $isDetailView = $_SESSION['view' . $this->getPage()->JobWindow->ID] == 'details';\r
                                $this->RepeaterShow->Visible = !$isDetailView;\r
                                $this->Repeater->DataSource = $isDetailView == false ? $jobs->output : array();\r
                                $this->Repeater->dataBind();\r
index 0ad8c417111efce1c7de472db8d150c1f8d9ed45..c0af626398627297e64ce649d3b3ca906836da92 100644 (file)
@@ -48,7 +48,7 @@ class JobRunList extends Portlets {
                                $params = $this->getUrlParams(array('jobs', 'tasks'), $this->getPage()->JobRunWindow->ID);\r
                                $jobTasks = $this->Application->getModule('api')->get($params)->output;\r
                                $jobs = $this->prepareJobs($jobTasks);\r
-                               $isDetailView = $this->Session['view' . $this->getPage()->JobRunWindow->ID] == 'details';\r
+                               $isDetailView = $_SESSION['view' . $this->getPage()->JobRunWindow->ID] == 'details';\r
                                $this->RepeaterShow->Visible = !$isDetailView;\r
                                $this->Repeater->DataSource = $isDetailView === false ? $jobs : array();\r
                                $this->Repeater->dataBind();\r
index 4e4944b962d4f2a69c94477e993a2bd90f42a847..240e63ca51820b59da3d7dcf5264af47105a2e99 100644 (file)
@@ -39,7 +39,7 @@ class PoolList extends Portlets {
                        if(in_array($this->getPage()->CallBackEventTarget->ID, $allowedButtons) || $forceReload) {\r
                                $params = $this->getUrlParams('pools', $this->getPage()->PoolWindow->ID);\r
                                $pools = $this->Application->getModule('api')->get($params);\r
-                               $isDetailView = $this->Session['view' . $this->getPage()->PoolWindow->ID] == 'details';\r
+                               $isDetailView = $_SESSION['view' . $this->getPage()->PoolWindow->ID] == 'details';\r
                                $this->RepeaterShow->Visible = !$isDetailView;\r
                                $this->Repeater->DataSource = $isDetailView === false ? $pools->output : array();\r
                                $this->Repeater->dataBind();\r
index db24c93479d6477c0aa806b78e4d27ee38032788..9c15722cc77ac97c61dff9f0a382e1b62341ae18 100644 (file)
@@ -23,7 +23,7 @@ class Portlets extends TTemplateControl {
        const SORT_DESC = 'desc';
 
        protected function getUrlParams($section, $id) {
-               $limit = $this->Session['limit' . $id];
+               $limit = $_SESSION['limit' . $id];
                if(is_numeric($limit)) {
                        if(is_array($section)) {
                                array_push($section, 'limit', $limit);
index 56a8c59768af45e3452f358b47dda46e4c6c18ed..ea2b0fa4477df2ace1e4df3f391dc6ed1c1a73a8 100644 (file)
@@ -39,9 +39,9 @@ class SlideWindow extends Portlets {
 
        public function onInit($param) {
                parent::onInit($param);
-               if(empty($this->Session['view' . $this->getParent()->ID]) && empty($this->Session['limit' . $this->getParent()->ID])) {
-                       $this->Session['view' . $this->getParent()->ID] = self::NORMAL_VIEW;
-                       $this->Session['limit' . $this->getParent()->ID] = 'unlimited';
+               if(empty($_SESSION['view' . $this->getParent()->ID]) && empty($_SESSION['limit' . $this->getParent()->ID])) {
+                       $_SESSION['view' . $this->getParent()->ID] = self::NORMAL_VIEW;
+                       $_SESSION['limit' . $this->getParent()->ID] = 'unlimited';
                }
        }
 
@@ -49,16 +49,16 @@ class SlideWindow extends Portlets {
                parent::onLoad($param);
                if(!$this->getPage()->IsPostBack) {
                        $this->Limit->dataSource = array_combine($this->elementsLimits, $this->elementsLimits);
-                       $this->Limit->SelectedValue = $this->Session['limit' . $this->getParent()->ID];
+                       $this->Limit->SelectedValue = $_SESSION['limit' . $this->getParent()->ID];
                        $this->Limit->dataBind();
-                       $this->Simple->Checked = ($this->Session['view' . $this->getParent()->ID] == self::NORMAL_VIEW);
-                       $this->Details->Checked = ($this->Session['view' . $this->getParent()->ID] == self::DETAIL_VIEW);
+                       $this->Simple->Checked = ($_SESSION['view' . $this->getParent()->ID] == self::NORMAL_VIEW);
+                       $this->Details->Checked = ($_SESSION['view' . $this->getParent()->ID] == self::DETAIL_VIEW);
                }
        }
 
        public function switchView($sender, $param) {
-               $this->Session['view' . $this->getParent()->ID] = ($this->Simple->Checked === true) ? self::NORMAL_VIEW : self::DETAIL_VIEW;
-               $this->Session['limit' . $this->getParent()->ID] = $this->Limit->SelectedValue;
+               $_SESSION['view' . $this->getParent()->ID] = ($this->Simple->Checked === true) ? self::NORMAL_VIEW : self::DETAIL_VIEW;
+               $_SESSION['limit' . $this->getParent()->ID] = $this->Limit->SelectedValue;
                $this->getParent()->prepareData(true);
        }
 }
index 20154272f84327a189bd4ba31e437ba231ee5b28..14c2309ad412094edebc1343fb135d2e5fd4c301 100644 (file)
@@ -39,7 +39,7 @@ class StorageList extends Portlets {
                        if(in_array($this->getPage()->CallBackEventTarget->ID, $allowedButtons) || $forceReload) {\r
                                $params = $this->getUrlParams('storages', $this->getPage()->StorageWindow->ID);\r
                                $storages = $this->Application->getModule('api')->get($params);\r
-                               $isDetailView = $this->Session['view' . $this->getPage()->StorageWindow->ID] == 'details';\r
+                               $isDetailView = $_SESSION['view' . $this->getPage()->StorageWindow->ID] == 'details';\r
                                $this->RepeaterShow->Visible = !$isDetailView;\r
                                $this->Repeater->DataSource = $isDetailView === false ? $storages->output : array();\r
                                $this->Repeater->dataBind();\r
index 7d6e2bc42f9ad3ed69ce183e2303fa9753511f04..dbf77393221efc6db7d118301bce52a149c8431d 100644 (file)
@@ -44,7 +44,7 @@ class VolumeList extends Portlets {
                                $params = $this->getUrlParams('volumes', $this->getPage()->VolumeWindow->ID);\r
                                array_push($params, '?showpools=1');\r
                                $volumes = $this->Application->getModule('api')->get($params);\r
-                               $isDetailView = $this->Session['view' . $this->getPage()->VolumeWindow->ID] == 'details';\r
+                               $isDetailView = $_SESSION['view' . $this->getPage()->VolumeWindow->ID] == 'details';\r
                                $this->RepeaterShow->Visible = !$isDetailView;\r
                                $this->Repeater->DataSource = $volumes->output;\r
                                $this->Repeater->dataBind();\r
index 11bd376c50c13534e702257dcc859ad40c02388c..a7bed824af74e5e279d9466d1ea2bad028a21afe 100644 (file)
@@ -88,7 +88,6 @@
                <module id="globalization" class="TGlobalization">
                        <translation type="gettext" source="Application.Lang" marker="@@" autosave="true" cache="false" DefaultCulture="en" />
                </module>
-               <module id="Session" class="THttpSession" SessionName="SSID" CookieMode="Allow" UseCustomStorage="false" AutoStart="true" GCProbability="1" UseTransparentSessionID="true" TimeOut="3600" />
                <module id="log" class="System.Util.TLogRouter">
                        <route class="TFileLogRoute"  Categories="Execute, External, Application, General, Security" LogPath="Application.Data" LogFile="baculum.log" MaxFileSize="1000" MaxLogFiles="5" />
                </module>