Commit 40def2bb111b72de3a5d65e597455357f1868525

Authored by Michael Joseph
1 parent 3979bde3

added session/authorisation check

added visual component stubs


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@127 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing 1 changed file with 45 additions and 8 deletions
dashboard.php
... ... @@ -15,22 +15,59 @@
15 15 */
16 16  
17 17 // main library routines and defaults
  18 +
18 19 require_once("./config/dmsDefaults.php");
19   -require_once("./lib/owl.lib.php");
20   -require_once("./config/html.php");
21   -require_once("./lib/control.inc");
22   -require_once("./lib/Session.inc");
23   -require_once("./lib/SiteMap.inc");
  20 +require_once("$default->owl_fs_root/lib/owl.lib.php");
  21 +require_once("$default->owl_fs_root/config/html.php");
  22 +require_once("$default->owl_fs_root/lib/control.inc");
  23 +require_once("$default->owl_fs_root/lib/Session.inc");
  24 +require_once("$default->owl_fs_root/lib/SiteMap.inc");
  25 +require_once("$default->owl_fs_root/lib/visualpatterns/PatternMainPage.inc");
  26 +require_once("$default->owl_fs_root/lib/visualpatterns/PatternImage.inc");
  27 +require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableLinks.inc");
  28 +require_once("$default->owl_fs_root/lib/visualpatterns/PatternTableSqlQuery.inc");
24 29  
25 30 // -------------------------------
26 31 // page start
27 32 // -------------------------------
28 33  
  34 +checkSession();
  35 +
29 36 // check if this page is authorised, ie. has come from control.php
30   -if ($sessionStatus["authorised"]) {
31   - echo generateLink("LOGOUT") . "logout</a>";
  37 +if ($_SESSION["authorised"]) {
  38 + // create a page
  39 +
  40 + // logo
  41 + $img = new PatternImage("$default->owl_root_url/locale/$default->owl_lang/graphics/$default->logo");
  42 +
  43 + // build the top menu of links
  44 + $aTopMenuLinks = array(0=>generateControllerUrl("LOGOUT"));
  45 + $aTopMenuText = array(0=>"logout");
  46 + $oPatternTableLinks = new PatternTableLinks($aTopMenuLinks, $aTopMenuText, 3, 1);
  47 +
  48 + // build the central dashboard
  49 + /*
  50 + $aCentralPageColumns = array(0=>"name",1=>"parent",2=>"security");
  51 + $aColumnTypes = array(0=>1,1=>2,2=>1);
  52 + $oTableSqlQuery = & new PatternTableSqlQuery("Folders", $aCentralPageColumns, $aColumnTypes);
  53 + ($HTTP_GET_VARS["fStartIndex"]) ? $oTableSqlQuery->setStartIndex($HTTP_GET_VARS["fStartIndex"]) : $oTableSqlQuery->setStartIndex(0);
  54 + $oTableSqlQuery->setLinkType(1);
  55 + */
  56 +
  57 + /* get a page */
  58 + $tmp = new PatternMainPage();
  59 +
  60 + /* put the page together */
  61 + $tmp->setNorthWestPayload($img);
  62 + $tmp->setNorthPayload($oPatternTableLinks);
  63 + //$tmp->setCentralPayload($oTableSqlQuery);
  64 + $tmp->setFormAction("dashboard.php");
  65 + $tmp->render();
  66 +
32 67 } else {
33 68 // FIXME: redirect to no permission page
34   - print "you do not have access to view this page! please go away, and come back when you do.";
  69 + print "you do not have access to view this page! please go away, and come back when you do.<br>";
  70 + echo generateLink("LOGOUT") . "logout</a>";
35 71 }
36 72 ?>
  73 +
... ...