aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'web/index.php')
-rw-r--r--web/index.php88
1 files changed, 2 insertions, 86 deletions
diff --git a/web/index.php b/web/index.php
index 6bb2f9f..aa17151 100644
--- a/web/index.php
+++ b/web/index.php
@@ -1,90 +1,6 @@
<?php
- require_once "config.php";
-
- if (RECAPTCHA_ENABLED) {
- require_once "recaptcha.php";
- }
-
- if (!SIMULTANEOUS_BUILDS) {
- $db = new mysqli(
- MYSQL_HOSTNAME,
- MYSQL_USERNAME,
- MYSQL_PASSWORD,
- MYSQL_DATABASE
- );
-
- if (mysqli_connect_errno()) {
- die("Could not connect to database ".mysqli_connect_error());
- }
-
- $ipaddress = filter_input(
- INPUT_SERVER,
- "REMOTE_ADDR",
- FILTER_VALIDATE_IP
- );
-
- $query = "SELECT id, handle ".
- "FROM builds WHERE ipaddress = ?";
- $stmt = $db->prepare($query);
- $stmt->bind_param("s", $ipaddress);
- $stmt->execute();
- $stmt->store_result();
-
- if ($stmt->num_rows == 1) {
- $stmt->bind_result($buildID, $handle);
- $stmt->fetch();
- $client = new GearmanClient();
- $client->addServer();
- $status = $client->jobStatus($handle);
- if ($status[0]) {
- $url = "status.php?uuid=".$buildID."&simultaneous=true";
- header("Location: ".$url);
- }
- }
- $stmt->close();
- }
-
- $timezones = array();
- $zonetab = file(ZONETAB);
- foreach ($zonetab as $buf) {
- if (substr($buf, 0, 1)=='#') {
- continue;
- }
- $rec = preg_split('/\s+/', $buf);
- $key = $rec[2];
- $val = $rec[2];
- $c = count($rec);
- for ($i=3;$i<$c;$i++) {
- $val.= ' '.$rec[$i];
- }
- $timezones[$key] = $val;
- ksort($timezones);
- }
- $timezoneOption = "";
- foreach ($timezones as $timezone => $description) {
- $timezoneOption .= "<option";
- if ($timezone == DEFAULT_TIMEZONE) {
- $timezoneOption .= " selected";
- }
- $timezoneOption .= ">".$timezone."</option>\n";
- }
- $layoutLines = file(GENTOASTER_PATH."/res/keyboard.lst");
- $keyboardOption = "";
- $layouts = array();
-
- foreach($layoutLines as $layout) {
- $layoutdata = explode("\t", $layout);
- $layouts[$layoutdata[0]] = $layoutdata[1];
- }
- asort($layouts);
-
- foreach($layouts as $layoutCode => $layoutName) {
- $keyboardOption .= "<option value=\"".$layoutCode."\"";
- if ($layoutCode == DEFAULT_KEYBOARD) {
- $keyboardOption .= " selected";
- }
- $keyboardOption .= ">".trim($layoutName)."</option>\n";
- }
+ require_once "config.php";
+ require_once GENTOASTER_PATH."/ui/index.php";
?>
<html>
<head>