Commit 55b30bad879af47c59c8a416b5b8fec55dcb430f

Authored by michael
1 parent f28a1eaa

fixed session handling and request forwarding


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@54 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 16 additions and 4 deletions
control.php
@@ -14,11 +14,10 @@ @@ -14,11 +14,10 @@
14 * @version $Id$ 14 * @version $Id$
15 * @Copyright (c) 1999-2002 The Owl Project Team 15 * @Copyright (c) 1999-2002 The Owl Project Team
16 * @author michael 16 * @author michael
17 - * @package dmsWebApplication 17 + * @package dms
18 */ 18 */
19 19
20 // main library routines and defaults 20 // main library routines and defaults
21 -require_once("./config/owl.php");  
22 require_once("./config/dmsDefaults.php"); 21 require_once("./config/dmsDefaults.php");
23 require_once("./lib/owl.lib.php"); 22 require_once("./lib/owl.lib.php");
24 require_once("./config/html.php"); 23 require_once("./config/html.php");
@@ -30,19 +29,32 @@ require_once("./lib/SiteMap.inc"); @@ -30,19 +29,32 @@ require_once("./lib/SiteMap.inc");
30 // page start 29 // page start
31 // ------------------------------- 30 // -------------------------------
32 31
33 -if (!checkSession($sessionID)) { 32 +if (!checkSession()) {
34 // no session, redirect to login 33 // no session, redirect to login
35 $action = "LOGIN_FORM"; 34 $action = "LOGIN_FORM";
  35 + // redirect to login page with redirect
  36 + $originalRequest = urlencode($_SERVER[REQUEST_URI]);// . $_SERVER[QUERY_STRING];
36 } 37 }
37 38
38 // retrieve the login page to redirect to 39 // retrieve the login page to redirect to
39 -$page = $default->siteMap->getPage($action, getUserClass($userID)) 40 +// FIXME: defaulting to A access
  41 +$page = $default->siteMap->getPage($action, "A");
  42 +//$page = $default->siteMap->getPage($action, getUserClass($userID));
40 43
41 // getPage returns false for no permisssion 44 // getPage returns false for no permisssion
42 if (!$page) { 45 if (!$page) {
43 // TODO: build no permission page 46 // TODO: build no permission page
44 print "you do not have access to view this page! please go away, and come back when you do."; 47 print "you do not have access to view this page! please go away, and come back when you do.";
45 } else { 48 } else {
  49 + //echo "about to redirect to $page<br>";
46 redirect($page); 50 redirect($page);
  51 + // FIXME: append original request if necessary
  52 + /*
  53 + if (isset($originalRequest)) {
  54 + redirect($page . "?fRedirect=$originalRequest");
  55 + } else {
  56 + redirect($page);
  57 + }
  58 + */
47 } 59 }
48 ?> 60 ?>