summaryrefslogtreecommitdiff
path: root/forum/utils/files.php
diff options
context:
space:
mode:
Diffstat (limited to 'forum/utils/files.php')
-rw-r--r--forum/utils/files.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/forum/utils/files.php b/forum/utils/files.php
index 6cae023..c698ede 100644
--- a/forum/utils/files.php
+++ b/forum/utils/files.php
@@ -125,9 +125,25 @@ class Files {
public function Files($file)
{
+ global $PERMSTORE;
+
$this->file = $file;
- $this->read();
- }
+ if(file_exists($file)) $this->read();
+ if(!file_exists($PERMSTORE)) {
+ if(!mkdir($PERMSTORE)) {
+ echo"Could not create directory: " . $PERMSTORE;
+ die();
+ }
+ }
+ if(!is_dir($PERMSTORE)) {
+ echo $PERMSTORE . " exists but is not a directory";
+ die();
+ }
+ if(!is_readable($PERMSTORE) || !is_writeable($PERMSTORE) || !is_executable($PERMSTORE)) {
+ echo $PERMSTORE . " exists but does not have the correct permissions. (r/w/x)";
+ die();
+ }
+ }
}
?> \ No newline at end of file