Commit 5649ff77fef348c3dd2b92ff6558649feb6be014

Authored by nbm
1 parent 2be66ff1

Propogate session error messages in control.php


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@5728 c91229c3-7414-0410-bfa2-8a42b809f60b
control.php
... ... @@ -53,7 +53,8 @@ $action = $_REQUEST['action'];
53 53 if ($action != "login") {
54 54  
55 55 // check the session, but don't redirect if the check fails
56   - if (checkSessionAndRedirect(false)) {
  56 + $ret = checkSessionAndRedirect(false);
  57 + if ($ret === true) {
57 58 //get around the problem with search
58 59 if (strcmp($_REQUEST['fForStandardSearch'], "yes") == 0) {
59 60 $action = "standardSearch";
... ... @@ -77,6 +78,9 @@ if ($action != "login") {
77 78 if ((strlen($redirect) > 1)) {
78 79 $url = $url . "&redirect=" . $redirect;
79 80 }
  81 + if (PEAR::isError($ret)) {
  82 + $url = $url . "&errorMessage=" . urlencode($ret->getMessage());
  83 + }
80 84 redirect($url);
81 85 exit(0);
82 86 }
... ...
lib/session/control.inc
... ... @@ -137,7 +137,7 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) {
137 137 // verification failed
138 138 $default->log->debug("checkSession:: session check failed");
139 139 if (empty($bRedirect)) {
140   - return false;
  140 + return $sessionStatus;
141 141 }
142 142  
143 143 $sErrorMessage = "";
... ...