added the DATA_UMASK config option

This commit is contained in:
dooble M 2012-08-19 10:22:37 +02:00
parent fa074d0126
commit f4524fe07b
2 changed files with 5 additions and 4 deletions

View file

@ -2,4 +2,5 @@
define('THUMB_SIZE', 100);
define('DATA_DIR', 'data');
define('IMAGES_DIR', 'images');
define('DATA_UMASK', 0002); # 0002: allow group to write for files created in data dir. change to 0022 to be more strict.
?>

View file

@ -63,8 +63,8 @@ function getPreview($imgFile, $maxSize = THUMB_SIZE)
return $imgFile;
}
# uncomment this if you need group writable files
#umask(0002);
# config to allow group writable files
umask(DATA_UMASK);
# create the thumbs directory recursively
if (! is_dir(dirname($newImgFile))) mkdir(dirname($newImgFile), 0777, true);
@ -103,8 +103,8 @@ function getAlbumPreview($dir)
} else if (is_file("$previewFile.png")) {
return "$previewFile.png";
} else {
# uncomment this if you need group writable files
#umask(0002);
# config to allow group writable files
umask(DATA_UMASK);
# create the thumbs directory recursively
if (! is_dir(dirname($previewFile))) mkdir(dirname($previewFile), 0777, true);