1 |
commit: aebdf3ef47a283793013a9da18c25c73458f400a |
2 |
Author: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> |
3 |
AuthorDate: Wed Jul 27 20:10:52 2011 +0000 |
4 |
Commit: Liam McLoughlin <hexxeh <AT> hexxeh <DOT> net> |
5 |
CommitDate: Wed Jul 27 20:10:52 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoaster.git;a=commit;h=aebdf3ef |
7 |
|
8 |
Add missing IP address parameter when creating job entry |
9 |
|
10 |
--- |
11 |
web/process.php | 14 +++++++------- |
12 |
1 files changed, 7 insertions(+), 7 deletions(-) |
13 |
|
14 |
diff --git a/web/process.php b/web/process.php |
15 |
index 9ba055b..1daaa86 100644 |
16 |
--- a/web/process.php |
17 |
+++ b/web/process.php |
18 |
@@ -5,12 +5,12 @@ |
19 |
|
20 |
require_once "config.php"; |
21 |
|
22 |
+ $ipaddress = filter_input(INPUT_SERVER, "REMOTE_ADDR", |
23 |
+ FILTER_VALIDATE_IP); |
24 |
+ |
25 |
if (RECAPTCHA_ENABLED) { |
26 |
require_once "recaptcha.php"; |
27 |
- |
28 |
- $remoteAddress = filter_input(INPUT_SERVER, |
29 |
- "REMOTE_ADDR", |
30 |
- FILTER_VALIDATE_IP); |
31 |
+ |
32 |
$challenge = filter_input(INPUT_POST, |
33 |
"recaptcha_challenge_field", |
34 |
FILTER_UNSAFE_RAW); |
35 |
@@ -19,7 +19,7 @@ |
36 |
FILTER_UNSAFE_RAW); |
37 |
|
38 |
$resp = recaptcha_check_answer(RECAPTCHA_PRIVATE_KEY, |
39 |
- $remoteAddress, |
40 |
+ $ipaddress, |
41 |
$challenge, |
42 |
$response); |
43 |
|
44 |
@@ -76,8 +76,8 @@ OUTPUT_FORMAT=$outputFormat"; |
45 |
die("Could not connect to database ".mysqli_connect_error()); |
46 |
} |
47 |
|
48 |
- $stmt = $db->prepare("INSERT INTO builds (id, handle) VALUES(?, ?)"); |
49 |
- $stmt->bind_param("ss", $buildID, $handle); |
50 |
+ $stmt = $db->prepare("INSERT INTO builds (id, handle, ipaddress) VALUES(?, ?, ?)"); |
51 |
+ $stmt->bind_param("sss", $buildID, $handle, $ipaddress); |
52 |
$stmt->execute(); |
53 |
$stmt->close(); |
54 |
$db->close(); |