From 768d566e037abd8d9b14a5c8c258fb2be1dca297 Mon Sep 17 00:00:00 2001 From: Neil Blakey-Milner Date: Wed, 15 Jun 2005 21:53:01 +0000 Subject: [PATCH] Don't reuse mis-used $_SESSION["errorMessage"], and instead make our own $_SESSION["KTErrorMessage"], which is an array of errors that errors can be pushed upon, and automatically be displayed in the Main Page the next time a page is seen. --- lib/session/Session.inc | 1 + lib/visualpatterns/PatternMainPage.inc | 9 +++++---- presentation/lookAndFeel/knowledgeTree/documentmanagement/emailBL.php | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/session/Session.inc b/lib/session/Session.inc index b7bda0d..8a51744 100644 --- a/lib/session/Session.inc +++ b/lib/session/Session.inc @@ -39,6 +39,7 @@ class Session { // bind user id to session $_SESSION["userID"] = $iUserID; + $_SESSION["KTErrorMessage"] = array(); // use the PHP generated session id $sessionID = session_id(); diff --git a/lib/visualpatterns/PatternMainPage.inc b/lib/visualpatterns/PatternMainPage.inc index bca93a7..99a29e7 100644 --- a/lib/visualpatterns/PatternMainPage.inc +++ b/lib/visualpatterns/PatternMainPage.inc @@ -206,10 +206,11 @@ class PatternMainPage { foreach ($this->sErrorMessage as $sErrorMessage) { $sToRender .= "

$sErrorMessage

\n "; } - if ($_SESSION['errorMessage']) { - $sErrorMessage = $_SESSION['errorMessage']; - $sToRender .= "

$sErrorMessage

\n "; - unset($_SESSION['errorMessage']); + if (count($_SESSION['KTErrorMessage'])) { + foreach ($_SESSION['KTErrorMessage'] as $sErrorMessage) { + $sToRender .= "

$sErrorMessage

\n "; + } + $_SESSION['KTErrorMessage'] = array(); } $sToRender = $sToRender . "\n" . $this->oCentralPayload->render() . "\n"; } else { diff --git a/presentation/lookAndFeel/knowledgeTree/documentmanagement/emailBL.php b/presentation/lookAndFeel/knowledgeTree/documentmanagement/emailBL.php index a62f692..1fed265 100644 --- a/presentation/lookAndFeel/knowledgeTree/documentmanagement/emailBL.php +++ b/presentation/lookAndFeel/knowledgeTree/documentmanagement/emailBL.php @@ -234,7 +234,7 @@ if (checkSession()) { sendManualEmails($aEmailAddresses, $oDocument, $fComment, (boolean)$fAttachDocument); if (count($emailerrors)) { - $_SESSION['errorMessage'] = join("
\n", $emailerrors); + $_SESSION['KTErrorMessage'][] = join("
\n", $emailerrors); } //go back to the document view page -- libgit2 0.21.4