Commit f48782a288e6c9fa518ff7335ecadbe2a9e39852
1 parent
445b1096
fixed handling of controller links- can now email controller links
git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@1924 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
10 additions
and
2 deletions
control.php
| ... | ... | @@ -22,7 +22,7 @@ require_once("./config/dmsDefaults.php"); |
| 22 | 22 | // ------------------------------- |
| 23 | 23 | // page start |
| 24 | 24 | // ------------------------------- |
| 25 | -//echo $_SERVER["QUERY_STRING"]; | |
| 25 | + | |
| 26 | 26 | // check the session, but don't redirect if the check fails |
| 27 | 27 | if (checkSessionAndRedirect(false)) { |
| 28 | 28 | //get around the problem with search |
| ... | ... | @@ -36,13 +36,21 @@ if (checkSessionAndRedirect(false)) { |
| 36 | 36 | // session check fails, so default action should be the login form if no action was specified |
| 37 | 37 | if (!isset($action)) { |
| 38 | 38 | $action = "loginForm"; |
| 39 | + } elseif ($action <> "loginForm") { | |
| 40 | + // we have a controller link and auth has failed, so redirect to the login page | |
| 41 | + // with the controller link as the redirect | |
| 42 | + $url = generateControllerUrl("loginForm"); | |
| 43 | + $redirect = urlencode($_SERVER[PHP_SELF] . "?" . $_SERVER['QUERY_STRING']); | |
| 44 | + if ((strlen($redirect) > 1)) { | |
| 45 | + $url = $url . "&redirect=" . $redirect; | |
| 46 | + } | |
| 47 | + redirect($url); | |
| 39 | 48 | } |
| 40 | 49 | } |
| 41 | 50 | |
| 42 | 51 | // need to strip query string params from action before attempting to retrieve from sitemap |
| 43 | 52 | |
| 44 | 53 | // check for the presence of additional params |
| 45 | -//echo $_SERVER["QUERY_STRING"]; | |
| 46 | 54 | if (strstr($_SERVER["QUERY_STRING"], "&")) { |
| 47 | 55 | // strip and save the querystring |
| 48 | 56 | $queryString = substr($_SERVER["QUERY_STRING"], strpos($_SERVER["QUERY_STRING"], "&")+1, strlen($_SERVER["QUERY_STRING"])); | ... | ... |