Skip to content
Browse files

clean up index.php

  • Loading branch information...
1 parent a0183ee commit 751c2628ea5af1b3b120ab4e9d15b732aca69e9a lucian0308 committed with bradymiller Nov 11, 2011
Showing with 11 additions and 16 deletions.
  1. +11 −16 index.php
View
27 index.php
@@ -3,28 +3,23 @@
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
-
// Set the site ID if required. This must be done before any database
// access is attempted.
if (!empty($_GET['site']))
- $site_id = $_GET['site'];
+ $site_id = $_GET['site'];
else if (is_dir("sites/" . $_SERVER['HTTP_HOST']))
- $site_id = $_SERVER['HTTP_HOST'];
+ $site_id = $_SERVER['HTTP_HOST'];
else
- $site_id = 'default';
+ $site_id = 'default';
if (empty($site_id) || preg_match('/[^A-Za-z0-9\\-.]/', $site_id))
- die("Site ID '$site_id' contains invalid characters.");
+ die("Site ID '$site_id' contains invalid characters.");
+
+require_once "sites/$site_id/sqlconf.php";
-require_once("sites/$site_id/sqlconf.php");
-?>
-<html>
-<?php if ($config == 1) { ?>
-<body ONLOAD="javascript:top.location.href='<?php echo "interface/login/login_frame.php?site=$site_id" ?>';">
-<?php } else { ?>
-<body ONLOAD="javascript:top.location.href='<?php echo "setup.php?site=$site_id" ?>';">
-<?php } ?>
-Redirecting...
-</body>
-</html>
+if ($config == 1) {
+ header("Location: interface/login/login_frame.php?site=$site_id");
+} else {
+ header("Location: setup.php?site=$site_id");
+}

0 comments on commit 751c262

Please sign in to comment.
Something went wrong with that request. Please try again.