diff options
author | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-07-24 03:10:52 +0100 |
---|---|---|
committer | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-07-24 03:34:15 +0100 |
commit | bc79e5240cd4544c9f953c48ecafdf4693bd1d64 (patch) | |
tree | bc892a47d623cb16459dc60a8e4e890351ad0a0d /status.php | |
parent | Use config file, defines to control settings, more Zend standards work (diff) | |
download | gentoaster-bc79e5240cd4544c9f953c48ecafdf4693bd1d64.tar.gz gentoaster-bc79e5240cd4544c9f953c48ecafdf4693bd1d64.tar.bz2 gentoaster-bc79e5240cd4544c9f953c48ecafdf4693bd1d64.zip |
Adding RECAPTCHA, more standards work
Diffstat (limited to 'status.php')
-rw-r--r-- | status.php | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -1,8 +1,18 @@ <?php - if (!isset($argv[1])) die("No handle hash given\n"); - $db = mysql_connect("localhost", "gentoaster", ""); - if (!$db) die("Could not connect to database ".mysql_error()."\n"); - mysql_select_db("gentoaster"); + + // Gentoaster build daemon status + // Licensed under GPL v3, see COPYING file + + require_once "config.php"; + + if (!isset($argv[1])) { + die("No handle hash given\n"); + } + $db = mysql_connect(MYSQL_HOSTNAME, MYSQL_USERNAME, MYSQL_PASSWORD); + if (!$db) { + die("Could not connect to database ".mysql_error()."\n"); + } + mysql_select_db(MYSQL_DATABASE); $query = "SELECT handle FROM builds ". "WHERE id = '".mysql_real_escape_string($argv[1])."'"; $result = mysql_query($query); @@ -26,7 +36,7 @@ "WHERE id = '".mysql_real_escape_string($argv[1])."'"; $result = mysql_query($query); $jobres = mysql_fetch_array($result); - if ($jobres[0] !== NULL) { + if ($jobres[0] !== null) { echo "Job returned with code ".$jobres[0].": ".$jobres[1]."\n"; } else { echo "Job failed\n"; |