diff options
author | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-07-27 21:10:52 +0100 |
---|---|---|
committer | Liam McLoughlin <hexxeh@hexxeh.net> | 2011-07-27 21:10:52 +0100 |
commit | aebdf3ef47a283793013a9da18c25c73458f400a (patch) | |
tree | def082242c03e099505a6e9622e6a706e2271374 /web/process.php | |
parent | Added simultaneous build settings (diff) | |
download | gentoaster-aebdf3ef47a283793013a9da18c25c73458f400a.tar.gz gentoaster-aebdf3ef47a283793013a9da18c25c73458f400a.tar.bz2 gentoaster-aebdf3ef47a283793013a9da18c25c73458f400a.zip |
Add missing IP address parameter when creating job entry
Diffstat (limited to 'web/process.php')
-rw-r--r-- | web/process.php | 14 |
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(); |