From f49efa989f2e1914de1a522820ecb8a23b96b534 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Mon, 17 Mar 2003 19:14:22 +0000 Subject: [PATCH] added support for sessions user is warned if lam.conf is not writable --- lam/config/config.php | 10 ++++++++-- lam/config/conflogin.php | 1 + lam/config/confmain.php | 2 ++ lam/config/confsave.php | 2 ++ lam/templates/main.php | 1 - 5 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lam/config/config.php b/lam/config/config.php index 9591143d..94ed3743 100644 --- a/lam/config/config.php +++ b/lam/config/config.php @@ -276,8 +276,14 @@ class Config { if (!$save_defShell == True) array_push($file_array, "\n\n# default shell when creating new user\n" . "defaultShell: " . $this->DefaultShell); if (!$save_shellList == True) array_push($file_array, "\n\n# list of possible shells\n" . "shellList: " . $this->ShellList); $file = fopen($conffile, "w"); - for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]); - fclose($file); + if ($file) { + for ($i = 0; $i < sizeof($file_array); $i++) fputs($file, $file_array[$i]); + fclose($file); + } + else { + echo _("
Cannot open config file!"); + exit; + } } } diff --git a/lam/config/conflogin.php b/lam/config/conflogin.php index b9760e23..670d6a77 100644 --- a/lam/config/conflogin.php +++ b/lam/config/conflogin.php @@ -22,6 +22,7 @@ $Id$ Login page to change the preferences. */ +session_start(); ?> diff --git a/lam/config/confmain.php b/lam/config/confmain.php index dfeb1753..5ea9b380 100644 --- a/lam/config/confmain.php +++ b/lam/config/confmain.php @@ -24,6 +24,8 @@ $Id$ */ +session_start(); + // check if password was entered // if not: load login page if (! $passwd) { diff --git a/lam/config/confsave.php b/lam/config/confsave.php index a7b0cd7b..79515d11 100644 --- a/lam/config/confsave.php +++ b/lam/config/confsave.php @@ -24,6 +24,8 @@ $Id$ */ +session_start(); + include_once ('config.php'); $conf = new Config(); diff --git a/lam/templates/main.php b/lam/templates/main.php index 62bff670..d9d55b58 100644 --- a/lam/templates/main.php +++ b/lam/templates/main.php @@ -23,7 +23,6 @@ $Id$ */ -session_start(); ?>