]> git.sur5r.net Git - bacula/bacula/commitdiff
baculum: Fix support for PHP 5.6
authorMarcin Haba <marcin.haba@bacula.pl>
Fri, 13 Mar 2015 20:57:29 +0000 (21:57 +0100)
committerMarcin Haba <marcin.haba@bacula.pl>
Fri, 13 Mar 2015 20:57:29 +0000 (21:57 +0100)
gui/baculum/protected/Class/BaculumAPI.php

index 4d6898fa5e332d731afccbada5788f2fe0b97eee..46c152f7575a635c51e9a1a73749acb2efbf85bf 100644 (file)
@@ -39,6 +39,12 @@ abstract class BaculumAPI extends TPage
 
        public function onInit($params) {
                parent::onInit($params);
+               /*
+                * Workaround to bug in PHP 5.6 by FastCGI that caused general protection error.
+                * TODO: Check on newer PHP if it is already fixed.
+                */
+               $db = new ActiveRecord();
+               $db->getDbConnection();
                $this->director = isset($this->Request['director']) ? $this->Request['director'] : null;
                $this->user = isset($this->Request['user']) ? $this->Request['user'] : null;
                if(is_null($this->user) && $this->Application->getModule('configuration')->isApplicationConfig() === true) {