Commit 768d566e037abd8d9b14a5c8c258fb2be1dca297

Authored by Neil Blakey-Milner
1 parent afebed2f

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.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@3385 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/session/Session.inc
@@ -39,6 +39,7 @@ class Session { @@ -39,6 +39,7 @@ class Session {
39 39
40 // bind user id to session 40 // bind user id to session
41 $_SESSION["userID"] = $iUserID; 41 $_SESSION["userID"] = $iUserID;
  42 + $_SESSION["KTErrorMessage"] = array();
42 43
43 // use the PHP generated session id 44 // use the PHP generated session id
44 $sessionID = session_id(); 45 $sessionID = session_id();
lib/visualpatterns/PatternMainPage.inc
@@ -206,10 +206,11 @@ class PatternMainPage { @@ -206,10 +206,11 @@ class PatternMainPage {
206 foreach ($this->sErrorMessage as $sErrorMessage) { 206 foreach ($this->sErrorMessage as $sErrorMessage) {
207 $sToRender .= "<table border=\"0\"><tr><td><p class=\"errorText\">$sErrorMessage</p></td></tr></table>\n "; 207 $sToRender .= "<table border=\"0\"><tr><td><p class=\"errorText\">$sErrorMessage</p></td></tr></table>\n ";
208 } 208 }
209 - if ($_SESSION['errorMessage']) {  
210 - $sErrorMessage = $_SESSION['errorMessage'];  
211 - $sToRender .= "<table border=\"0\"><tr><td><p class=\"errorText\">$sErrorMessage</p></td></tr></table>\n ";  
212 - unset($_SESSION['errorMessage']); 209 + if (count($_SESSION['KTErrorMessage'])) {
  210 + foreach ($_SESSION['KTErrorMessage'] as $sErrorMessage) {
  211 + $sToRender .= "<table border=\"0\"><tr><td><p class=\"errorText\">$sErrorMessage</p></td></tr></table>\n ";
  212 + }
  213 + $_SESSION['KTErrorMessage'] = array();
213 } 214 }
214 $sToRender = $sToRender . "\n" . $this->oCentralPayload->render() . "\n"; 215 $sToRender = $sToRender . "\n" . $this->oCentralPayload->render() . "\n";
215 } else { 216 } else {
presentation/lookAndFeel/knowledgeTree/documentmanagement/emailBL.php
@@ -234,7 +234,7 @@ if (checkSession()) { @@ -234,7 +234,7 @@ if (checkSession()) {
234 sendManualEmails($aEmailAddresses, $oDocument, $fComment, (boolean)$fAttachDocument); 234 sendManualEmails($aEmailAddresses, $oDocument, $fComment, (boolean)$fAttachDocument);
235 235
236 if (count($emailerrors)) { 236 if (count($emailerrors)) {
237 - $_SESSION['errorMessage'] = join("<br />\n", $emailerrors); 237 + $_SESSION['KTErrorMessage'][] = join("<br />\n", $emailerrors);
238 } 238 }
239 239
240 //go back to the document view page 240 //go back to the document view page