From 5f31cbef1a451a9f43ad07cebf393b52d7368cb7 Mon Sep 17 00:00:00 2001 From: Roland Gruber Date: Thu, 3 Jun 2004 10:50:01 +0000 Subject: [PATCH] removed user PDF text --- lam/lib/config.inc | 47 ------------------------------- lam/templates/config/confmain.php | 16 ----------- lam/templates/config/confsave.php | 8 ------ 3 files changed, 71 deletions(-) diff --git a/lam/lib/config.inc b/lam/lib/config.inc index dcb81150..78ce5001 100644 --- a/lam/lib/config.inc +++ b/lam/lib/config.inc @@ -167,9 +167,6 @@ class Config { /** Password hash algorithm */ var $pwdhash; - /** Text to include in user PDF files */ - var $pdftext = ""; - /** * Account modules * TODO add default modules for LAM <0.5 @@ -228,14 +225,6 @@ class Config { else { 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 */ @@ -339,7 +328,6 @@ class Config { echo "" . _("User modules") . ": " . $this->usermodules . "
"; echo "" . _("Group modules") . ": " . $this->groupmodules . "
"; echo "" . _("Host modules") . ": " . $this->hostmodules . "

"; - echo "" . _("Text for user PDF") . ": " . $this->get_pdftext(); } // functions to read/write preferences @@ -856,41 +844,6 @@ class Config { 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 * diff --git a/lam/templates/config/confmain.php b/lam/templates/config/confmain.php index d6959fde..4eaf84bc 100644 --- a/lam/templates/config/confmain.php +++ b/lam/templates/config/confmain.php @@ -68,7 +68,6 @@ if ($_POST['back'] || $_POST['submitconf'] || $_POST['editmodules']){ $_SESSION['conf_pwdhash'] = $_POST['pwdhash']; $_SESSION['conf_scriptpath'] = $_POST['scriptpath']; $_SESSION['conf_scriptserver'] = $_POST['scriptserver']; - $_SESSION['conf_pdf_usertext'] = $_POST['pdf_usertext']; $_SESSION['conf_usermodules'] = explode(",", $_POST['usermodules']); $_SESSION['conf_groupmodules'] = explode(",", $_POST['groupmodules']); $_SESSION['conf_hostmodules'] = explode(",", $_POST['hostmodules']); @@ -139,7 +138,6 @@ if ($_GET["modulesback"] == "true") { $conf->set_scriptpath($_SESSION['conf_scriptpath']); $conf->set_scriptserver($_SESSION['conf_scriptserver']); $conf->set_pwdhash($_SESSION['conf_pwdhash']); - $conf->set_pdftext($_SESSION['conf_pdf_usertext']); // check if modules were edited if ($_GET["moduleschanged"] == "true") { $conf->set_UserModules($_SESSION['conf_usermodules']); @@ -381,20 +379,6 @@ 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 echo ("
" . _("Security settings") . "\n"); echo ("\n"); diff --git a/lam/templates/config/confsave.php b/lam/templates/config/confsave.php index 0c2d4829..c2901ce6 100644 --- a/lam/templates/config/confsave.php +++ b/lam/templates/config/confsave.php @@ -66,7 +66,6 @@ $lang = $_SESSION['conf_lang']; $scriptpath = $_SESSION['conf_scriptpath']; $scriptserver = $_SESSION['conf_scriptserver']; $pwdhash = $_SESSION['conf_pwdhash']; -$pdftext = $_SESSION['conf_pdf_usertext']; $filename = $_SESSION['conf_filename']; // check if password is correct @@ -197,12 +196,6 @@ if (!$conf->set_pwdhash($pwdhash)) { exit; } -if (!$conf->set_pdftext($pdftext)) { - echo ("" . _("Saving PDF text failed!") . ""); - echo ("\n


" . _("Back to preferences...") . ""); - exit; -} - if (! $conf->set_UserModules($_SESSION['conf_usermodules'])) { echo ("" . _("Saving user modules failed!") . ""); echo ("\n


" . _("Back to preferences...") . ""); @@ -268,7 +261,6 @@ unset($_SESSION['conf_lang']); unset($_SESSION['conf_scriptpath']); unset($_SESSION['conf_scriptserver']); unset($_SESSION['conf_pwdhash']); -unset($_SESSION['conf_pdf_usertext']); unset($_SESSION['conf_filename']); unset($_SESSION['conf_usermodules']); unset($_SESSION['conf_groupmodules']);