From 0b2091cc10ccb748adc89c58a19b367308f047c7 Mon Sep 17 00:00:00 2001 From: Liam McLoughlin Date: Thu, 4 Aug 2011 22:04:00 +0100 Subject: Fix simultaneous build detection, fix sorting on keyboard layouts --- web/index.php | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/web/index.php b/web/index.php index 4903bbb..dcaae6b 100644 --- a/web/index.php +++ b/web/index.php @@ -23,18 +23,23 @@ FILTER_VALIDATE_IP ); - $query = "SELECT id, returncode ". + $query = "SELECT id, handle ". "FROM builds WHERE ipaddress = ?"; $stmt = $db->prepare($query); - $stmt->bind_param("sd", $ipaddress, $returncode); + $stmt->bind_param("s", $ipaddress); $stmt->execute(); $stmt->store_result(); - if ($stmt->num_rows == 1 && $returncode === null) { - $stmt->bind_result($buildID); + if ($stmt->num_rows == 1) { + $stmt->bind_result($buildID, $handle); $stmt->fetch(); - $url = "status.php?uuid=".$buildID."&simultaneous=true"; - header("Location: ".$url); + $client = new GearmanClient(); + $client->addServer(); + $status = $client->jobStatus($handle); + if ($status[0]) { + $url = "status.php?uuid=".$buildID."&simultaneous=true"; + header("Location: ".$url); + } } $stmt->close(); } @@ -65,17 +70,21 @@ } $layoutLines = file(GENTOASTER_PATH."/res/keyboard.lst"); $keyboardOption = ""; + $layouts = array(); foreach($layoutLines as $layout) { $layoutdata = explode("\t", $layout); - $keyboardOption .= "\n"; } - - asort($layouts); ?> -- cgit v1.2.3-65-gdbad