check if smarty compile directory is writeable for the current user or exit if not
authorAndreas Unterkircher <unki@netshadow.at>
Sun, 30 Dec 2007 14:45:39 +0000 (15:45 +0100)
committerAndreas Unterkircher <unki@netshadow.at>
Sun, 30 Dec 2007 14:45:39 +0000 (15:45 +0100)
phpfspot.class.php

index bfe415534e1aab68de5b786f1db3f4deed4498e9..ba3668759757b1bbf2c86be97c34e2b8e0abe984 100644 (file)
@@ -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 */