Commit 1eddc70d8c2b4a5e5fc677385458a4b9fea8e61a

Authored by Michael Joseph
1 parent daf4744d

persist redirect on login failure


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2048 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 6 additions and 7 deletions
presentation/login.php
@@ -74,10 +74,11 @@ if ($loginAction == "loginForm") { @@ -74,10 +74,11 @@ if ($loginAction == "loginForm") {
74 </body> 74 </body>
75 </html>"; 75 </html>";
76 76
77 -}  
78 -elseif ($loginAction == "login") { 77 +} elseif ($loginAction == "login") {
79 // set default url for login failure 78 // set default url for login failure
80 - $url = $url . "login.php?loginAction=loginForm"; 79 + // with redirect appended if set
  80 + $url = $url . "login.php?loginAction=loginForm" . (isset($redirect) ? "&redirect=$redirect" : "");
  81 +
81 // if requirements are met and we have a username and password to authenticate 82 // if requirements are met and we have a username and password to authenticate
82 if( isset($fUserName) && isset($fPassword) ) { 83 if( isset($fUserName) && isset($fPassword) ) {
83 // verifies the login and password of the user 84 // verifies the login and password of the user
@@ -143,13 +144,11 @@ elseif ($loginAction == &quot;login&quot;) { @@ -143,13 +144,11 @@ elseif ($loginAction == &quot;login&quot;) {
143 // didn't receive any login parameters, so redirect login form 144 // didn't receive any login parameters, so redirect login form
144 // TODO: set "no login parameters received error message? 145 // TODO: set "no login parameters received error message?
145 // internal error message- should never happen 146 // internal error message- should never happen
  147 + $default->log->error("
146 } 148 }
147 if (strlen($queryString) > 0) { 149 if (strlen($queryString) > 0) {
148 $url .= "&$queryString"; 150 $url .= "&$queryString";
149 } 151 }
150 - $default->log->debug("login.php: about to redirect to $url");  
151 redirect($url); 152 redirect($url);
152 } 153 }
153 -?>  
154 -  
155 - 154 +?>
156 \ No newline at end of file 155 \ No newline at end of file