diff options
author | 2009-07-24 11:33:04 -0400 | |
---|---|---|
committer | 2009-07-24 11:33:04 -0400 | |
commit | 3b8dc0e7e38fd3470e3d2c2fa51a2a7c20d02499 (patch) | |
tree | 5d5860981deaa4a66174418b975e528f5703a490 /frontend | |
parent | Broke log viewer into segments, added build deletion (diff) | |
download | ingenue-3b8dc0e7e38fd3470e3d2c2fa51a2a7c20d02499.tar.gz ingenue-3b8dc0e7e38fd3470e3d2c2fa51a2a7c20d02499.tar.bz2 ingenue-3b8dc0e7e38fd3470e3d2c2fa51a2a7c20d02499.zip |
Require manually-configured URL - backend needs it anyway
Diffstat (limited to 'frontend')
-rw-r--r-- | frontend/functions/url.php | 24 | ||||
-rw-r--r-- | frontend/include/setup.php | 11 | ||||
-rw-r--r-- | frontend/js/url.js.php | 2 | ||||
-rw-r--r-- | frontend/pages/404.php | 7 |
4 files changed, 5 insertions, 39 deletions
diff --git a/frontend/functions/url.php b/frontend/functions/url.php deleted file mode 100644 index 2cac083..0000000 --- a/frontend/functions/url.php +++ /dev/null @@ -1,24 +0,0 @@ -<?php -// Makes all URLs absolute -function url($url='') { - global $conf, $S; - if (strlen($url) == 0) { - return $S['root'].($conf['mod_rewrite']?'':'/index.php'); - } elseif (substr($url, 0, 7) == 'http://') { - return $url; - } - if ($conf['mod_rewrite']) { - return $S['root'].'/'.$url; - } else { - if (strpos($url, '?')) { - $q=substr($url, strpos($url, '?')+1); - $url=substr($url, 0, strpos($url, '?')); - } - if (strlen($url)) { - return $S['root'].'/index.php?req='.$url.(isset($q)?'&'.$q:''); - } else { - return $S['root'].'/index.php?'.$q; - } - } -} -?> diff --git a/frontend/include/setup.php b/frontend/include/setup.php index 6e9e9e9..2239c6c 100644 --- a/frontend/include/setup.php +++ b/frontend/include/setup.php @@ -12,21 +12,12 @@ $S=array_merge($S, array( 'head_scripts' => array(), 'debug' => null, 'debugrow' => 0, - 'root' => null, 'cookie_dir' => null, 'start' => microtime(true), 'sql' => null )); unset($_REQUEST['req'], $_GET['req']); -if (isset($conf['rootDir'])) { // What on Earth is going on here? - $cDir=substr($cDir, strpos($cDir, '/', 8)); // Cuts the http://, the domain name - $S['cookie_dir']=$cDir.'/'; - $S['root']=$conf['rootDir']; -} else { - $cDir=dirname($_SERVER['PHP_SELF']); // We're assumed to always be running /index.php - $S['cookie_dir']=$cDir; - $S['root']=rtrim('http://'.$_SERVER['HTTP_HOST'].($_SERVER['SERVER_PORT']==(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']?443:80)?'':':'.$_SERVER['SERVER_PORT']).$cDir, '/'); -} +$S['cookie_dir']=substr($conf['url'], strpos($conf['url'], '/', 8)).'/'; require_once(SHARED.'/include/dbinit.php'); if (isset($_COOKIE[$conf['cookiename']])) { $cookie=$_COOKIE[$conf['cookiename']]; diff --git a/frontend/js/url.js.php b/frontend/js/url.js.php index 358a0df..a1b2b93 100644 --- a/frontend/js/url.js.php +++ b/frontend/js/url.js.php @@ -1,5 +1,5 @@ <?php // vim:filetype=javascript // Equivalent to php function of the same name ?> function url (relative) { - return "<?php echo $S['root'] ?>/"+relative; + return "<?php echo $conf['url'] ?>/"+relative; } diff --git a/frontend/pages/404.php b/frontend/pages/404.php index e19c818..ffc3b79 100644 --- a/frontend/pages/404.php +++ b/frontend/pages/404.php @@ -1,11 +1,10 @@ <?php function init_404() { - global $S; - $S['title']='404: Not Found'; header('HTTP/1.0 404 Not Found', true, 404); + return array('title' => '404: Not Found'); } function body_404() { - global $S; - echo print_error('Page Not Found!','The page you are trying to reach, <i>'.$S['root'].'/'.$S['request'].'</i> does not exist.'); + global $S, $conf; + echo print_error('Page Not Found!','The page you are trying to reach, <i>'.$conf['url'].'/'.$S['request'].'</i> does not exist.'); } ?> |