Commit a0e2ff8a39b9f4e58f7c471694fc2029223dacfe

Authored by Michael Joseph
1 parent 2af6e14d

updated to fix querystring redirect bugs


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@742 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 11 additions and 1 deletions
presentation/login.php
... ... @@ -79,7 +79,14 @@ if ($loginAction == "loginForm") {
79 79 $tmp = urldecode($redirect);
80 80 $default->log->debug("login.php: substr($tmp, strpos($tmp, $default->owl_root_url), strlen($tmp))");
81 81 $redirect = substr($tmp, strpos($tmp, $default->owl_root_url), strlen($tmp));
82   - $default->log->debug("login.php: redirect=$redirect");
  82 + $default->log->debug("login.php: redirect=$redirect");
  83 + }
  84 +
  85 + // remove any params from redirect before looking up from sitemap
  86 + if (strstr($redirect, "?")) {
  87 + $queryString = substr($redirect, strpos($redirect, "?")+1, strlen($redirect));
  88 + $redirect = substr($redirect, 0, strpos($redirect, "?"));
  89 + $default->log->debug("login.php redirect=$redirect; querystring=$queryString");
83 90 }
84 91 $url = generateControllerUrl($default->siteMap->getActionFromPage($redirect));
85 92 // else redirect to the dashboard
... ... @@ -103,6 +110,9 @@ if ($loginAction == "loginForm") {
103 110 // TODO: set "no login parameters received error message?
104 111 // internal error message- should never happen
105 112 }
  113 + if (strlen($queryString) > 0) {
  114 + $url .= "&$queryString";
  115 + }
106 116 $default->log->debug("login.php: about to redirect to $url");
107 117 redirect($url);
108 118 }
... ...