added PDF text

This commit is contained in:
Roland Gruber 2003-11-15 10:35:58 +00:00
parent 543f0d4119
commit 885ef93eaf
6 changed files with 35 additions and 17 deletions

View File

@ -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"),

View File

@ -291,7 +291,8 @@ class Config {
echo "<b>" . _("Default language") . ": </b>" . $this->defaultLanguage . "<br>";
echo "<b>" . _("Path to external script") . ": </b>" . $this->scriptPath . "<br>";
echo "<b>" . _("Server of external script") . ": </b>" . $this->scriptServer . "<br>";
echo "<b>" . _("List of valid users") . ": </b>" . $this->Admins;
echo "<b>" . _("List of valid users") . ": </b>" . $this->Admins . "<br><br>";
echo "<b>" . _("Text for user PDF") . ": </b>" . $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;

View File

@ -62,8 +62,6 @@ echo $_SESSION['header'];
?>
<html>
<head>
<title>
<?php
echo _("Login");

View File

@ -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") . "</title>\n");
echo ("<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n");
echo "<meta http-equiv=\"pragma\" content=\"no-cache\">\n";
@ -303,12 +302,13 @@ echo ("<td><a href=\"../help.php?HelpNumber=209\" target=\"lamhelp\">" . _("Help
echo ("</table>\n");
echo ("</fieldset>\n");
echo ("<p></p>\n");
// script settings
echo ("<fieldset><legend><b>" . _("Script settings") . "</b></legend>\n");
echo ("<table border=0>\n");
// script settings
echo ("<tr><td align=\"right\"><b>".
_("Path to external script") . ": </b></td>".
"<td><input size=50 type=\"text\" name=\"scriptpath\" value=\"" . $conf->get_scriptPath() . "\"></td>\n");
@ -320,6 +320,21 @@ echo ("<td><a href=\"../help.php?HelpNumber=211\" target=\"lamhelp\">" . _("Help
echo ("</table>\n");
echo ("</fieldset>\n");
echo ("<p></p>\n");
// PDF settings
echo ("<fieldset><legend><b>" . _("PDF settings") . "</b></legend>\n");
echo ("<table border=0>\n");
echo ("<tr><td align=\"right\"><b>".
_("Text for user PDF") . ": </b></td>".
"<td><textarea name=\"pdf_usertext\" cols=\"80\" rows=\"5\">" . $conf->get_pdftext() . "</textarea></td>\n");
echo ("<td><a href=\"../help.php?HelpNumber=216\" target=\"lamhelp\">" . _("Help") . "</a></td></tr>\n");
echo ("</table>\n");
echo ("</fieldset>\n");
echo ("<p></p>\n");
// security setings

View File

@ -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 "<html><head><title>listusers</title>\n";
echo "<title>listusers</title>\n";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../../style/layout.css\">\n";
echo "<meta http-equiv=\"pragma\" content=\"no-cache\">\n";
echo "<meta http-equiv=\"cache-control\" content=\"no-cache\">\n";
@ -196,6 +197,11 @@ if (!$conf->set_pwdhash($pwdhash)) {
exit;
}
if (!$conf->set_pdftext($pdftext)) {
echo ("<font color=\"red\"><b>" . _("PDF text is invalid!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
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']);
?>

View File

@ -36,8 +36,6 @@ echo $_SESSION['header'];
?>
<html>
<head>
<title>
<?php
echo _("Profile management");