X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=phpfspot.git;a=blobdiff_plain;f=phpfspot.class.php;h=23f0c5462c466621614c15e1e989df6deff8e46c;hp=bfe415534e1aab68de5b786f1db3f4deed4498e9;hb=3ca950a9f47ade37c1e805810efcce77d1b3be9d;hpb=cd94f8e46b565a4528dda5ddb602918f0bf13896 diff --git a/phpfspot.class.php b/phpfspot.class.php index bfe4155..23f0c54 100644 --- a/phpfspot.class.php +++ b/phpfspot.class.php @@ -63,15 +63,21 @@ class PHPFSPOT { $this->dbver = $this->getFspotDBVersion(); if(!is_writeable(dirname($this->cfg->phpfspot_db))) { - print dirname($this->cfg->phpfspot_db) .": directory is not writeable!"; + print dirname($this->cfg->phpfspot_db) .": directory is not writeable for user ". $this->getuid() ."\n"; exit(1); } - + + if(!is_writeable($this->cfg->base_path ."/templates_c")) { + print $this->cfg->base_path ."/templates_c: directory is not writeable for user ". $this->getuid() ."\n"; + exit(1); + } + $this->cfg_db = new PHPFSPOT_DB($this, $this->cfg->phpfspot_db); if(!is_writeable($this->cfg->phpfspot_db)) { print $this->cfg->phpfspot_db ." is not writeable for user ". $this->getuid() ."\n"; exit(1); } + $this->check_config_table(); /* include Smarty template engine */ @@ -86,7 +92,9 @@ class PHPFSPOT { /* check if all necessary indices exist */ $this->checkDbIndices(); - session_start(); + /* if session is not yet started, do it now */ + if(session_id() == "") + session_start(); if(!isset($_SESSION['tag_condition'])) $_SESSION['tag_condition'] = 'or';