diff --git a/lam/help/help.inc b/lam/help/help.inc index 74793ba6..ae0a98b5 100644 --- a/lam/help/help.inc +++ b/lam/help/help.inc @@ -106,6 +106,8 @@ $helpArray = array ( "Text" => _("This is the time in minutes which LAM caches its LDAP searches. Shorter times will stress LDAP more but decrease the possibility that changes are not identified.")), "215" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Password hash type"), "Text" => _("LAM supports CRYPT, SHA, SSHA, MD5 and SMD5 to generate the hash value of an user password. SSHA and CRYPT are the most common but CRYPT does not support passwords greater than 8 letters. We do not recommend to use plain text passwords.")), + "216" => array ("ext" => "FALSE", "Headline" => _("Configuration Wizard") . " - " . _("Text for user PDF"), + "Text" => _("This text will appear on top of every user PDF file.")), "230" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Add profile"), "Text" => _("Please enter the name of the new profile and the password to change its settings. Profile names may contain letters, numbers and -/_.")), "231" => array ("ext" => "FALSE", "Headline" => _("Profile management") . " - " . _("Rename profile"), diff --git a/lam/lib/config.inc b/lam/lib/config.inc index d73307cc..7f692c0e 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -291,7 +291,8 @@ class Config { echo "" . _("Default language") . ": " . $this->defaultLanguage . "
"; echo "" . _("Path to external script") . ": " . $this->scriptPath . "
"; echo "" . _("Server of external script") . ": " . $this->scriptServer . "
"; - echo "" . _("List of valid users") . ": " . $this->Admins; + echo "" . _("List of valid users") . ": " . $this->Admins . "

"; + echo "" . _("Text for user PDF") . ": " . $this->get_pdftext(); } // functions to read/write preferences @@ -676,14 +677,11 @@ class Config { function set_pdftext($value) { if (is_string($value)) { $pdffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/pdf/" . $this->file . ".txt"; - if (is_file($pdffile)) { - $file = @fopen($pdffile, "w"); - if ($file) { - @fputs($file, $value); - fclose($file); - $this->pdftext = $value; - } - else return false; + $file = @fopen($pdffile, "w"); + if ($file) { + @fputs($file, $value); + fclose($file); + $this->pdftext = $value; } else return false; $this->pdftext = $value; diff --git a/lam/templates/config/conflogin.php b/lam/templates/config/conflogin.php index d78d6bc5..27d6e126 100644 --- a/lam/templates/config/conflogin.php +++ b/lam/templates/config/conflogin.php @@ -62,8 +62,6 @@ echo $_SESSION['header']; ?> - - <?php echo _("Login"); diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index 16b3f259..c7931cfe 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -62,6 +62,7 @@ if ($_POST['back'] || $_POST['submitconf']){ $_SESSION['conf_pwdhash'] = $_POST['pwdhash']; $_SESSION['conf_scriptpath'] = $_POST['scriptpath']; $_SESSION['conf_scriptserver'] = $_POST['scriptserver']; + $_SESSION['conf_pdf_usertext'] = $_POST['pdf_usertext']; $_SESSION['conf_filename'] = $_POST['filename']; metaRefresh("confsave.php"); } @@ -95,8 +96,6 @@ if (!(($conf->get_Passwd()) == $passwd)) { echo $_SESSION['header']; -echo ("<html>\n"); -echo ("<head>\n"); echo ("<title>" . _("LDAP Account Manager Configuration") . "\n"); echo ("\n"); echo "\n"; @@ -303,12 +302,13 @@ echo ("" . _("Help echo ("\n"); echo ("\n"); + echo ("

\n"); +// script settings echo ("
" . _("Script settings") . "\n"); echo ("\n"); -// script settings echo ("". "\n"); @@ -320,6 +320,21 @@ echo ("
". _("Path to external script") . ": get_scriptPath() . "\">" . _("Help echo ("
\n"); echo ("
\n"); + +echo ("

\n"); + +// PDF settings +echo ("
" . _("PDF settings") . "\n"); +echo ("\n"); + +echo ("". + "\n"); +echo ("\n"); + +echo ("
". + _("Text for user PDF") . ": " . _("Help") . "
\n"); +echo ("
\n"); + echo ("

\n"); // security setings diff --git a/lam/templates/config/confsave.php b/lam/templates/config/confsave.php index 7c895732..206e81d6 100644 --- a/lam/templates/config/confsave.php +++ b/lam/templates/config/confsave.php @@ -59,6 +59,7 @@ $scriptpath = $_SESSION['conf_scriptpath']; $scriptserver = $_SESSION['conf_scriptserver']; $samba3 = $_SESSION['conf_samba3']; $pwdhash = $_SESSION['conf_pwdhash']; +$pdftext = $_SESSION['conf_pdf_usertext']; $filename = $_SESSION['conf_filename']; // check if password is correct @@ -70,7 +71,7 @@ if ($passwd != $conf->get_Passwd()) { echo $_SESSION['header']; -echo "listusers\n"; +echo "listusers\n"; echo "\n"; echo "\n"; echo "\n"; @@ -196,6 +197,11 @@ if (!$conf->set_pwdhash($pwdhash)) { exit; } +if (!$conf->set_pdftext($pdftext)) { + echo ("" . _("PDF text is invalid!") . ""); + echo ("\n


" . _("Back to preferences...") . ""); + exit; +} // check if password was changed @@ -245,6 +251,7 @@ unset($_SESSION['conf_scriptpath']); unset($_SESSION['conf_scriptserver']); unset($_SESSION['conf_samba3']); unset($_SESSION['conf_pwdhash']); +unset($_SESSION['conf_pdf_usertext']); unset($_SESSION['conf_filename']); ?> diff --git a/lam/templates/config/profmanage.php b/lam/templates/config/profmanage.php index c9bae135..9d6d55b2 100644 --- a/lam/templates/config/profmanage.php +++ b/lam/templates/config/profmanage.php @@ -36,8 +36,6 @@ echo $_SESSION['header']; ?> - - <?php echo _("Profile management");