From 09f692b87ae33b42d136faef4a47fac657ff8922 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Sun, 23 Oct 2005 09:20:19 +0000 Subject: [PATCH] added checks for file permissions --- lam/HISTORY | 1 + lam/templates/login.php | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/lam/HISTORY b/lam/HISTORY index d1edb518..1f611125 100644 --- a/lam/HISTORY +++ b/lam/HISTORY @@ -1,5 +1,6 @@ ??? 0.5.2 - New module for SSH public keys + - check file permissions on login page - fixed bugs: -> creation of home directories did not work diff --git a/lam/templates/login.php b/lam/templates/login.php index 51d6ed92..8230b6e6 100644 --- a/lam/templates/login.php +++ b/lam/templates/login.php @@ -149,6 +149,15 @@ function display_LoginPage($config_object) { StatusMessage("ERROR", "Your PHP has no gettext support!", "Please install gettext for PHP."); echo "

"; } + // check file permissions + $writableDirs = array('config', 'config/profiles', 'config/pdf', 'sess', 'tmp', ); + for ($i = 0; $i < sizeof($writableDirs); $i++) { + $path = realpath('../') . "/" . $writableDirs[$i]; + if (!is_writable($path)) { + StatusMessage("ERROR", _('The directory %s is not writable for the web server. Please change your file permissions.'), '', array($path)); + echo "
"; + } + } ?>