Commit 16df60073a811f9be9738be482debf8b95a0ae38

Authored by Michael Joseph
1 parent 89da7f06

fixed querystring bug


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@572 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 8 additions and 6 deletions
control.php
... ... @@ -39,11 +39,10 @@ if (checkSessionAndRedirect(false)) {
39 39 // need to strip query string params from action before attempting to retrieve from sitemap
40 40  
41 41 // check for the presence of additional params
42   -if (strstr($action, "?")) {
43   - // strip them off
44   - $queryString = substr($action, strpos($action, "?")+1, strlen($action));
45   - // crop the action
46   - $action = substr($action, 0, strpos($action, "?"));
  42 +$default->log->info("control.php qs=" . $_SERVER["QUERY_STRING"]);
  43 +if (strstr($_SERVER["QUERY_STRING"], "&")) {
  44 + // save the querystring
  45 + $queryString = substr($_SERVER["QUERY_STRING"], strpos($_SERVER["QUERY_STRING"], "&")+1, strlen($_SERVER["QUERY_STRING"]));
47 46 $default->log->info("control.php qs=$queryString; action=$action");
48 47 }
49 48  
... ... @@ -60,7 +59,9 @@ if (!$page) {
60 59 $default->log->debug("control.php redirect=$redirect");
61 60 $page = $default->owl_root_url . $page;
62 61 // set authorised flag and redirect
63   - // strip querystring form $page before setting page authorisation flag
  62 + // strip querystring from the page returned from the sitemap
  63 + // before setting page authorisation flag (since checkSession checks page level
  64 + // access by checking $_SESSION["pageAccess"][$_SERVER["PHP_SELF"] ie. without querystring(?)
64 65 if (strstr($page, "?")) {
65 66 $accessPage = substr($page, 0, strpos($page, "?"));
66 67 $default->log->debug("control.php: page without querystring=$accessPage; with=$page");
... ... @@ -68,6 +69,7 @@ if (!$page) {
68 69 $accessPage = $page;
69 70 }
70 71  
  72 + // if we have a redirect url, then append it(??)
71 73 if (strlen($redirect) > 0) {
72 74 $page = $page . (strstr($page, "?") ? "&redirect=$redirect" : "?redirect=$redirect");
73 75 }
... ...