Commit abc0941dc624f0fb90229402fe1c6ac3a1a0a9be

Authored by Megan Watson
1 parent e979d149

KTS-1345

"Following a hyperlink from an MS Office doc works the first time but subsequently goes to dashboard until user logs out"
The login script was finding the current session and going straight to the dashboard, ignoring the redirect link.

Committed by: Megan Watson
Reviewed by: Conrad Vermeulen



git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@7212 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 13 additions and 1 deletions
login.php
@@ -54,7 +54,19 @@ class LoginPageDispatcher extends KTDispatcher { @@ -54,7 +54,19 @@ class LoginPageDispatcher extends KTDispatcher {
54 ; // that's ok - we want to login. 54 ; // that's ok - we want to login.
55 } 55 }
56 else { 56 else {
57 - exit(redirect(generateControllerLink('dashboard'))); 57 + // User is already logged in - get the redirect
  58 + $redirect = KTUtil::arrayGet($_REQUEST, 'redirect');
  59 +
  60 + $cookietest = KTUtil::randomString();
  61 + setcookie("CookieTestCookie", $cookietest, 0);
  62 +
  63 + $this->redirectTo('checkCookie', array(
  64 + 'cookieVerify' => $cookietest,
  65 + 'redirect' => $redirect,
  66 + ));
  67 + exit(0);
  68 + // The old way -> doesn't take the redirect into account
  69 + //exit(redirect(generateControllerLink('dashboard')));
58 } 70 }
59 } 71 }
60 return true; 72 return true;