Commit 3e7887ad622c5bf5a029e5cc7c3eca58d0718d80

Authored by Neil Blakey-Milner
1 parent f2cad87f

Fix up indentation and copious whitespace


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@2999 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 15 additions and 16 deletions
control.php
@@ -2,15 +2,14 @@ @@ -2,15 +2,14 @@
2 2
3 // main library routines and defaults 3 // main library routines and defaults
4 require_once("./config/dmsDefaults.php"); 4 require_once("./config/dmsDefaults.php");
5 -//require_once("$default->fileSystemRoot/lib/session/SiteMap.inc");  
6 5
7 /** 6 /**
8 - * $Id$  
9 - * 7 + * $Id$
  8 + *
10 * Controller page -- controls the web application by responding to a set of 9 * Controller page -- controls the web application by responding to a set of
11 * defined actions. The controller performs session handling, page-level 10 * defined actions. The controller performs session handling, page-level
12 * authentication and forwards the request to the appropriate handling 11 * authentication and forwards the request to the appropriate handling
13 - * page. 12 + * page.
14 * 13 *
15 * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING. 14 * Licensed under the GNU GPL. For full terms see the file DOCS/COPYING.
16 * 15 *
@@ -25,20 +24,20 @@ require_once("./config/dmsDefaults.php"); @@ -25,20 +24,20 @@ require_once("./config/dmsDefaults.php");
25 24
26 // check the session, but don't redirect if the check fails 25 // check the session, but don't redirect if the check fails
27 if (checkSessionAndRedirect(false)) { 26 if (checkSessionAndRedirect(false)) {
28 - //get around the problem with search  
29 - if (strcmp($fForStandardSearch, "yes") == 0) {  
30 - $action = "standardSearch";  
31 - } else if (!isset($action)) {  
32 - // session check succeeds, so default action should be the dashboard if no action was specified  
33 - $action = "dashboard";  
34 - }  
35 -} else { 27 + //get around the problem with search
  28 + if (strcmp($fForStandardSearch, "yes") == 0) {
  29 + $action = "standardSearch";
  30 + } else if (!isset($action)) {
  31 + // session check succeeds, so default action should be the dashboard if no action was specified
  32 + $action = "dashboard";
  33 + }
  34 +} else {
36 // session check fails, so default action should be the login form if no action was specified 35 // session check fails, so default action should be the login form if no action was specified
37 if (!isset($action)) { 36 if (!isset($action)) {
38 $action = "loginForm"; 37 $action = "loginForm";
39 } elseif ($action <> "loginForm") { 38 } 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 39 + // we have a controller link and auth has failed, so redirect to the login page
  40 + // with the controller link as the redirect
42 $url = generateControllerUrl("loginForm"); 41 $url = generateControllerUrl("loginForm");
43 $redirect = urlencode($_SERVER[PHP_SELF] . "?" . $_SERVER['QUERY_STRING']); 42 $redirect = urlencode($_SERVER[PHP_SELF] . "?" . $_SERVER['QUERY_STRING']);
44 if ((strlen($redirect) > 1)) { 43 if ((strlen($redirect) > 1)) {
@@ -60,7 +59,7 @@ if (strstr($_SERVER[&quot;QUERY_STRING&quot;], &quot;&amp;&quot;)) { @@ -60,7 +59,7 @@ if (strstr($_SERVER[&quot;QUERY_STRING&quot;], &quot;&amp;&quot;)) {
60 // update 59 // update
61 $action = substr($_SERVER["QUERY_STRING"], 0, strpos($_SERVER["QUERY_STRING"], "?")); 60 $action = substr($_SERVER["QUERY_STRING"], 0, strpos($_SERVER["QUERY_STRING"], "?"));
62 } 61 }
63 - 62 +
64 // retrieve the page from the sitemap (checks whether this user has access to the requested page) 63 // retrieve the page from the sitemap (checks whether this user has access to the requested page)
65 $page = $default->siteMap->getPage($action, isset($_SESSION["userID"]) ? $_SESSION["userID"] : ""); 64 $page = $default->siteMap->getPage($action, isset($_SESSION["userID"]) ? $_SESSION["userID"] : "");
66 65
@@ -81,7 +80,6 @@ if (!$page) { @@ -81,7 +80,6 @@ if (!$page) {
81 } else { 80 } else {
82 $accessPage = $page; 81 $accessPage = $page;
83 } 82 }
84 -  
85 $_SESSION["pageAccess"][$accessPage] = true; 83 $_SESSION["pageAccess"][$accessPage] = true;
86 // if we have a querystring add it on 84 // if we have a querystring add it on
87 if (strlen($queryString) > 0) { 85 if (strlen($queryString) > 0) {
@@ -90,4 +88,5 @@ if (!$page) { @@ -90,4 +88,5 @@ if (!$page) {
90 } 88 }
91 redirect($page); 89 redirect($page);
92 } 90 }
  91 +
93 ?> 92 ?>