summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Unterkircher <unki@netshadow.at>2008-01-20 16:38:17 +0100
committerAndreas Unterkircher <unki@netshadow.at>2008-01-20 16:38:17 +0100
commitaf297e166b77efb1746f1d396b404102e0f89e15 (patch)
tree09a40dd6ea6d0c372c43a75dd28f119203ff7a7a
parent8f46e095700c4c44b0aa3e216ca9b43bcc2fe9e6 (diff)
check if thumbnail-directory is writeable
Signed-off-by: Andreas Unterkircher <unki@netshadow.at>
-rw-r--r--phpfspot.class.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/phpfspot.class.php b/phpfspot.class.php
index b4d8b17..088e74d 100644
--- a/phpfspot.class.php
+++ b/phpfspot.class.php
@@ -88,6 +88,11 @@ class PHPFSPOT {
exit(1);
}
+ if(!is_writeable($this->cfg->thumb_path)) {
+ print $this->cfg->thumb_path .": 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";
@@ -1377,6 +1382,7 @@ class PHPFSPOT {
$thumb_sub_path = substr($file_md5, 0, 2);
$thumb_path = $this->cfg->thumb_path ."/". $thumb_sub_path ."/". $resolution ."_". $file_md5;
+ /* if thumbnail-subdirectory does not exist yet, create it */
if(!file_exists(dirname($thumb_path))) {
mkdir(dirname($thumb_path), 0755);
}