removed user PDF text

This commit is contained in:
Roland Gruber 2004-06-03 10:50:01 +00:00
parent 1a61d3a7dd
commit 5f31cbef1a
3 changed files with 0 additions and 71 deletions

View File

@ -167,9 +167,6 @@ class Config {
/** Password hash algorithm */ /** Password hash algorithm */
var $pwdhash; var $pwdhash;
/** Text to include in user PDF files */
var $pdftext = "";
/** /**
* Account modules * Account modules
* TODO add default modules for LAM <0.5 * TODO add default modules for LAM <0.5
@ -228,14 +225,6 @@ class Config {
else { else {
StatusMessage("ERROR", "", _("Unable to load configuration!") . " (" . $conffile . ")"); StatusMessage("ERROR", "", _("Unable to load configuration!") . " (" . $conffile . ")");
} }
// load user PDF text
$pdffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/pdf/" . $this->file . ".txt";
if (is_file($pdffile) == True) {
$pdfstring = @file($pdffile);
$pdfstring = @implode("", $pdfstring);
if ($pdfstring) $this->pdftext = $pdfstring;
else $this->pdftext = "";
}
} }
/** Saves preferences to config file */ /** Saves preferences to config file */
@ -339,7 +328,6 @@ class Config {
echo "<b>" . _("User modules") . ": </b>" . $this->usermodules . "<br>"; echo "<b>" . _("User modules") . ": </b>" . $this->usermodules . "<br>";
echo "<b>" . _("Group modules") . ": </b>" . $this->groupmodules . "<br>"; echo "<b>" . _("Group modules") . ": </b>" . $this->groupmodules . "<br>";
echo "<b>" . _("Host modules") . ": </b>" . $this->hostmodules . "<br><br>"; echo "<b>" . _("Host modules") . ": </b>" . $this->hostmodules . "<br><br>";
echo "<b>" . _("Text for user PDF") . ": </b>" . $this->get_pdftext();
} }
// functions to read/write preferences // functions to read/write preferences
@ -856,41 +844,6 @@ class Config {
return true; return true;
} }
/**
* Returns text for user PDF files
*
* @return text string
*/
function get_pdftext($name = "user") {
if ($this->pdftext) return $this->pdftext;
else return "";
}
/**
* Sets the text for user PDF files
*
* @param $value string containing the text
* @return true if $value has correct format and could be saved
*/
function set_pdftext($value) {
// check if text changed
if ($value == $this->pdftext) return true;
if (is_string($value)) {
// save to file
$pdffile = substr(__FILE__, 0, strlen(__FILE__) - 15) . "/config/pdf/" . $this->file . ".txt";
$file = @fopen($pdffile, "w");
if ($file) {
@fputs($file, $value);
fclose($file);
$this->pdftext = $value;
}
else return false;
$this->pdftext = $value;
}
else return false;
return true;
}
/** /**
* Returns an array of all selected user modules * Returns an array of all selected user modules
* *

View File

@ -68,7 +68,6 @@ if ($_POST['back'] || $_POST['submitconf'] || $_POST['editmodules']){
$_SESSION['conf_pwdhash'] = $_POST['pwdhash']; $_SESSION['conf_pwdhash'] = $_POST['pwdhash'];
$_SESSION['conf_scriptpath'] = $_POST['scriptpath']; $_SESSION['conf_scriptpath'] = $_POST['scriptpath'];
$_SESSION['conf_scriptserver'] = $_POST['scriptserver']; $_SESSION['conf_scriptserver'] = $_POST['scriptserver'];
$_SESSION['conf_pdf_usertext'] = $_POST['pdf_usertext'];
$_SESSION['conf_usermodules'] = explode(",", $_POST['usermodules']); $_SESSION['conf_usermodules'] = explode(",", $_POST['usermodules']);
$_SESSION['conf_groupmodules'] = explode(",", $_POST['groupmodules']); $_SESSION['conf_groupmodules'] = explode(",", $_POST['groupmodules']);
$_SESSION['conf_hostmodules'] = explode(",", $_POST['hostmodules']); $_SESSION['conf_hostmodules'] = explode(",", $_POST['hostmodules']);
@ -139,7 +138,6 @@ if ($_GET["modulesback"] == "true") {
$conf->set_scriptpath($_SESSION['conf_scriptpath']); $conf->set_scriptpath($_SESSION['conf_scriptpath']);
$conf->set_scriptserver($_SESSION['conf_scriptserver']); $conf->set_scriptserver($_SESSION['conf_scriptserver']);
$conf->set_pwdhash($_SESSION['conf_pwdhash']); $conf->set_pwdhash($_SESSION['conf_pwdhash']);
$conf->set_pdftext($_SESSION['conf_pdf_usertext']);
// check if modules were edited // check if modules were edited
if ($_GET["moduleschanged"] == "true") { if ($_GET["moduleschanged"] == "true") {
$conf->set_UserModules($_SESSION['conf_usermodules']); $conf->set_UserModules($_SESSION['conf_usermodules']);
@ -381,20 +379,6 @@ echo ("</fieldset>\n");
echo ("<p></p>\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 // security setings
echo ("<fieldset><legend><b>" . _("Security settings") . "</b></legend>\n"); echo ("<fieldset><legend><b>" . _("Security settings") . "</b></legend>\n");
echo ("<table border=0>\n"); echo ("<table border=0>\n");

View File

@ -66,7 +66,6 @@ $lang = $_SESSION['conf_lang'];
$scriptpath = $_SESSION['conf_scriptpath']; $scriptpath = $_SESSION['conf_scriptpath'];
$scriptserver = $_SESSION['conf_scriptserver']; $scriptserver = $_SESSION['conf_scriptserver'];
$pwdhash = $_SESSION['conf_pwdhash']; $pwdhash = $_SESSION['conf_pwdhash'];
$pdftext = $_SESSION['conf_pdf_usertext'];
$filename = $_SESSION['conf_filename']; $filename = $_SESSION['conf_filename'];
// check if password is correct // check if password is correct
@ -197,12 +196,6 @@ if (!$conf->set_pwdhash($pwdhash)) {
exit; exit;
} }
if (!$conf->set_pdftext($pdftext)) {
echo ("<font color=\"red\"><b>" . _("Saving PDF text failed!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
exit;
}
if (! $conf->set_UserModules($_SESSION['conf_usermodules'])) { if (! $conf->set_UserModules($_SESSION['conf_usermodules'])) {
echo ("<font color=\"red\"><b>" . _("Saving user modules failed!") . "</b></font>"); echo ("<font color=\"red\"><b>" . _("Saving user modules failed!") . "</b></font>");
echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>"); echo ("\n<br><br><br><a href=\"javascript:history.back()\">" . _("Back to preferences...") . "</a>");
@ -268,7 +261,6 @@ unset($_SESSION['conf_lang']);
unset($_SESSION['conf_scriptpath']); unset($_SESSION['conf_scriptpath']);
unset($_SESSION['conf_scriptserver']); unset($_SESSION['conf_scriptserver']);
unset($_SESSION['conf_pwdhash']); unset($_SESSION['conf_pwdhash']);
unset($_SESSION['conf_pdf_usertext']);
unset($_SESSION['conf_filename']); unset($_SESSION['conf_filename']);
unset($_SESSION['conf_usermodules']); unset($_SESSION['conf_usermodules']);
unset($_SESSION['conf_groupmodules']); unset($_SESSION['conf_groupmodules']);