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,7 +53,8 @@ $action = $_REQUEST['action'];
53 if ($action != "login") { 53 if ($action != "login") {
54 54
55 // check the session, but don't redirect if the check fails 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 //get around the problem with search 58 //get around the problem with search
58 if (strcmp($_REQUEST['fForStandardSearch'], "yes") == 0) { 59 if (strcmp($_REQUEST['fForStandardSearch'], "yes") == 0) {
59 $action = "standardSearch"; 60 $action = "standardSearch";
@@ -77,6 +78,9 @@ if ($action != "login") { @@ -77,6 +78,9 @@ if ($action != "login") {
77 if ((strlen($redirect) > 1)) { 78 if ((strlen($redirect) > 1)) {
78 $url = $url . "&redirect=" . $redirect; 79 $url = $url . "&redirect=" . $redirect;
79 } 80 }
  81 + if (PEAR::isError($ret)) {
  82 + $url = $url . "&errorMessage=" . urlencode($ret->getMessage());
  83 + }
80 redirect($url); 84 redirect($url);
81 exit(0); 85 exit(0);
82 } 86 }
lib/session/control.inc
@@ -137,7 +137,7 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) { @@ -137,7 +137,7 @@ function checkSessionAndRedirect($bRedirect, $bDownload = false) {
137 // verification failed 137 // verification failed
138 $default->log->debug("checkSession:: session check failed"); 138 $default->log->debug("checkSession:: session check failed");
139 if (empty($bRedirect)) { 139 if (empty($bRedirect)) {
140 - return false; 140 + return $sessionStatus;
141 } 141 }
142 142
143 $sErrorMessage = ""; 143 $sErrorMessage = "";