aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiam McLoughlin <hexxeh@hexxeh.net>2011-07-27 21:10:52 +0100
committerLiam McLoughlin <hexxeh@hexxeh.net>2011-07-27 21:10:52 +0100
commitaebdf3ef47a283793013a9da18c25c73458f400a (patch)
treedef082242c03e099505a6e9622e6a706e2271374
parentAdded simultaneous build settings (diff)
downloadgentoaster-aebdf3ef47a283793013a9da18c25c73458f400a.tar.gz
gentoaster-aebdf3ef47a283793013a9da18c25c73458f400a.tar.bz2
gentoaster-aebdf3ef47a283793013a9da18c25c73458f400a.zip
Add missing IP address parameter when creating job entry
-rw-r--r--web/process.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/web/process.php b/web/process.php
index 9ba055b..1daaa86 100644
--- a/web/process.php
+++ b/web/process.php
@@ -5,12 +5,12 @@
require_once "config.php";
+ $ipaddress = filter_input(INPUT_SERVER, "REMOTE_ADDR",
+ FILTER_VALIDATE_IP);
+
if (RECAPTCHA_ENABLED) {
require_once "recaptcha.php";
-
- $remoteAddress = filter_input(INPUT_SERVER,
- "REMOTE_ADDR",
- FILTER_VALIDATE_IP);
+
$challenge = filter_input(INPUT_POST,
"recaptcha_challenge_field",
FILTER_UNSAFE_RAW);
@@ -19,7 +19,7 @@
FILTER_UNSAFE_RAW);
$resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY,
- $remoteAddress,
+ $ipaddress,
$challenge,
$response);
@@ -76,8 +76,8 @@ OUTPUT_FORMAT=$outputFormat";
die("Could not connect to database ".mysqli_connect_error());
}
- $stmt = $db->prepare("INSERT INTO builds (id, handle) VALUES(?, ?)");
- $stmt->bind_param("ss", $buildID, $handle);
+ $stmt = $db->prepare("INSERT INTO builds (id, handle, ipaddress) VALUES(?, ?, ?)");
+ $stmt->bind_param("sss", $buildID, $handle, $ipaddress);
$stmt->execute();
$stmt->close();
$db->close();