From 2e28269baed195d58bbe169841eed176b171db76 Mon Sep 17 00:00:00 2001 From: VirtualTam Date: Wed, 11 Nov 2015 22:49:58 +0100 Subject: install: check file/directory permissions for Shaarli resources Relates to #40 Relates to #372 Additions: - FileUtils: IOException - ApplicationUtils: - check if Shaarli resources are accessible with sufficient permissions - basic test coverage - index.php: - check access permissions and redirect to an error page if needed: - before running the first installation Modifications: - LinkDB: - factorize datastore write code - check if the datastore (exists AND is writeable) OR (doesn't exist AND its parent dir is writable) - raise an IOException if needed Signed-off-by: VirtualTam --- application/FileUtils.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 application/FileUtils.php (limited to 'application/FileUtils.php') diff --git a/application/FileUtils.php b/application/FileUtils.php new file mode 100644 index 00000000..6a12ef0e --- /dev/null +++ b/application/FileUtils.php @@ -0,0 +1,19 @@ +path = $path; + $this->message = 'Error accessing '.$this->path; + } +} -- cgit v1.2.3