X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=www%2Findex.php;h=340401d6183c44a1a27e3df26008d365e9fa58a1;hb=018b041d077a8740dde27529a1ffc32f4610b7ef;hp=c75a15765557b337bb369f0819bd9985d9535aae;hpb=6fdbfe32798452ec1c0fdbda57edabb892518409;p=readifood.git diff --git a/www/index.php b/www/index.php index c75a157..340401d 100644 --- a/www/index.php +++ b/www/index.php @@ -8,10 +8,10 @@ $root = join(DIRECTORY_SEPARATOR, array($_SERVER['DOCUMENT_ROOT'], "..")); $propel_root = join(DIRECTORY_SEPARATOR, array($root, "propel")); $lib_root = join(DIRECTORY_SEPARATOR, array($root, "lib")); - require_once "propel/Propel.php"; + require_once(join(DIRECTORY_SEPARATOR, array($root, "vendor", "autoload.php"))); Propel::init("$propel_root/build/conf/$propel_project-conf.php"); - set_include_path(join(PATH_SEPARATOR, array("$propel_root/build/classes", get_include_path()))); + set_include_path(join(PATH_SEPARATOR, array(join(DIRECTORY_SEPARATOR, array($propel_root, "build", "classes")), get_include_path()))); $request = preg_replace('!^/branches/[^/]+/!', "", $_SERVER['REQUEST_URI']); $request = preg_replace('!^/+!', "", $request); @@ -28,21 +28,28 @@ else $module = strtolower($module); #echo "request: $request; module: $module; params: " . print_r($parameters, true); + $http = (isset($_SERVER['HTTPS'])) ? "https" : "http"; $username = $_SERVER['REMOTE_USER']; - include_once("$lib_root/constants.php"); - include_once("$lib_root/functions.php"); - include_once("$lib_root/header.php"); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "constants.php"))); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "functions.php"))); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "session.php"))); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "header.php"))); $q = new UserQuery; $user = $q->findOneByUsername($username); if (! $q->count()) { + echo "

$charity

\n"; echo "

Not logged in!

\n"; if ($_SERVER['REMOTE_USER']) echo "

User " . $_SERVER['REMOTE_USER'] . " needs an entry in the user table.

\n"; } else { $user_id = $user->getContactId(); $admin_level = $user->getAdmin(); - if ($module) include_once("$lib_root/$module.php"); - #else include_once("$lib_root/menu.php"); + if ($module) { + echo "

$charity $module

\n"; + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "$module.php"))); + } + + #else include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "menu.php"))); } - include_once("$lib_root/footer.php"); + include_once(join(DIRECTORY_SEPARATOR, array($lib_root, "footer.php"))); ?>