diff options
Diffstat (limited to 'web/index.php')
-rw-r--r-- | web/index.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/web/index.php b/web/index.php index 6b6abec..a68a219 100644 --- a/web/index.php +++ b/web/index.php @@ -5,6 +5,29 @@ 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); + + $stmt = $db->prepare("SELECT id FROM builds WHERE ipaddress = ?"); + $stmt->bind_param("s", $ipaddress); + $stmt->execute(); + $stmt->store_result(); + + if ($stmt->num_rows == 1) { + $stmt->bind_result($buildID); + $stmt->fetch(); + header("Location: status.php?uuid=".$buildID."&simultaneous=true"); + } + $stmt->close(); + } + $timezones = array(); $zonetab = file(ZONETAB); foreach ($zonetab as $buf) { |