Skip to content
Snippets Groups Projects
Commit 997888bc authored by Graham Cole's avatar Graham Cole
Browse files

automagically figure out whether to use [ORIG_]PATH_INFO, and move dbuser to settings

parent 5f0cd086
No related branches found
No related tags found
No related merge requests found
......@@ -14,7 +14,6 @@ if (@$displaytime) {
Settings
-------------------------------------------------------- */
$dbuser="apache"; // Temporary bodge by dez - should be in settings.php
include("settings.php");
if (!(isset($base) && isset($preferred_hostname) && isset($dbname))) {
echo "Website unconfigured";
......@@ -93,9 +92,15 @@ 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);
// Need to use ORIG_PATH_INFO in user homedirs
if (isset($_SERVER['PATH_INFO'])) {
$pathinfo = $_SERVER['PATH_INFO'];
} else {
$pathinfo = @$_SERVER['ORIG_PATH_INFO'];
}
// Determine which component to run
$pathlist = explode('/', parse_url(@$_SERVER['PATH_INFO'],PHP_URL_PATH));
$pathlist = explode('/', parse_url($pathinfo,PHP_URL_PATH));
while (end($pathlist) === "") array_pop($pathlist);
$smarty->assign_by_ref("pathlist", $pathlist);
$path = '';
......@@ -131,6 +136,7 @@ $smarty->assign("title", "Set Me");
$smarty->assign("body", "Empty Body");
include($base."components/menu.php");
//include($base."components/search.php");
// Load the component
$comppath = $base."components/".$component['component'].".php";
......@@ -174,7 +180,7 @@ if (@$displaytime) {
$smarty->assign("totaltime", $totaltime);
}
$smarty->display("foot".$language['file'].".tpl");
$smarty->display("foot".$language['file'].".tpl");
} else {
echo $compoutput;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment