diff --git a/lam/templates/login.php b/lam/templates/login.php index 8230b6e6..e95fc746 100644 --- a/lam/templates/login.php +++ b/lam/templates/login.php @@ -28,6 +28,50 @@ $Id$ * @package main */ +/** status messages */ +include_once("../lib/status.inc"); + +// check environment +$criticalErrors = array(); +// check if PHP has session support +if (! function_exists('session_start')) { + $criticalErrors[] = array("ERROR", "Your PHP has no session support!", "Please install the session extension for PHP."); +} +// check if PHP has LDAP support +if (! function_exists('ldap_search')) { + $criticalErrors[] = array("ERROR", "Your PHP has no LDAP support!", "Please install the LDAP extension for PHP."); +} +// check if PHP has gettext support +if (! function_exists('gettext') || !function_exists('_')) { + $criticalErrors[] = array("ERROR", "Your PHP has no gettext support!", "Please install gettext for PHP."); +} +// 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)) { + $criticalErrors[] = array("ERROR", _('The directory %s is not writable for the web server. Please change your file permissions.'), '', array($path)); + } +} +// stop login if critical errors occured +if (sizeof($criticalErrors) > 0) { + echo "\n"; + echo "\n\n"; + echo "\n
\n"; + echo "\n"; + echo "\n \n"; + echo ""; + echo "