diff --git a/htdocs/index.php b/htdocs/index.php index 231a10fa466ad9f14345b0e191fd0e75fed9ef54..0cff96492f66027af1f1eb69f1cdd3613f294dec 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -40,7 +40,7 @@ $smarty->assign("baseurl", $baseurl); // Initialise the database require("/usr/share/php/adodb/adodb.inc.php"); $DB = NewADOConnection('postgres8'); -$DB->Connect('dbname='.$dbname.' user=apache'); +$DB->Connect('dbname='.$dbname.' user=dez'); $DB->SetFetchMode(ADODB_FETCH_ASSOC); // Include the session library @@ -92,9 +92,8 @@ if (($n=strpos($ssl_path,"?"))!==FALSE) $ssl_path=substr($ssl_path,0,$n); $ssl_url = "https://".$preferred_hostname.$ssl_path; $smarty->assign("ssl_url", $ssl_url); - // Determine which component to run -$pathlist = explode('/', parse_url(@$_SERVER['PATH_INFO'],PHP_URL_PATH)); +$pathlist = explode('/', parse_url(@$_SERVER['ORIG_PATH_INFO'],PHP_URL_PATH)); while (end($pathlist) === "") array_pop($pathlist); $smarty->assign_by_ref("pathlist", $pathlist); $path = ''; @@ -129,7 +128,6 @@ if ($path == "") $path="/"; $smarty->assign("title", "Set Me"); $smarty->assign("body", "Empty Body"); -include($base."components/menu.php"); // Load the component $comppath = $base."components/".$component['component'].".php"; @@ -146,6 +144,8 @@ if (file_exists($comppath)) { // Pass error/warning/info messages to the template $smarty->assign("user_messages", $messages); +include($base."components/menu.php"); + // Render the results if (!(isset($no_template)) || (!$no_template)) { // Send appropriate Content-Type