aboutsummaryrefslogtreecommitdiff
path: root/web
diff options
context:
space:
mode:
authorLiam McLoughlin <hexxeh@hexxeh.net>2011-08-06 00:37:00 +0100
committerLiam McLoughlin <hexxeh@hexxeh.net>2011-08-06 00:37:00 +0100
commitee02363d07131379c1e2537cffa20c453f596cad (patch)
tree4f770efa72aee4a7daa9f1b80f8c8a4ba7a43c8a /web
parentFix simultaneous build detection, fix sorting on keyboard layouts (diff)
downloadgentoaster-ee02363d07131379c1e2537cffa20c453f596cad.tar.gz
gentoaster-ee02363d07131379c1e2537cffa20c453f596cad.tar.bz2
gentoaster-ee02363d07131379c1e2537cffa20c453f596cad.zip
Add email notification support
Diffstat (limited to 'web')
-rw-r--r--web/index.php12
-rw-r--r--web/process.php7
2 files changed, 16 insertions, 3 deletions
diff --git a/web/index.php b/web/index.php
index dcaae6b..f46af2b 100644
--- a/web/index.php
+++ b/web/index.php
@@ -1,5 +1,6 @@
<?php
require_once "config.php";
+ require_once GENTOASTER_PATH."/config.php";
if (RECAPTCHA_ENABLED) {
require_once "recaptcha.php";
@@ -116,6 +117,17 @@
of your own personalised Gentoo virtual machine
image.</p>
</div>
+ <?php if(SMTP_ENABLED) { ?>
+ <div id="notifications" class="step">
+ <h1>Notifications</h1>
+ Want us to email you when your image has finished toasting?
+ Pop your email in here. If you don't want an email, simply
+ leave this field blank.<br /><br />
+ <label for="notifications_email">E-Mail</label>
+ <br />
+ <input type="text" name="email" id="notifications_email">
+ </div>
+ <?php } ?>
<?php
if (RECAPTCHA_ENABLED) {
?>
diff --git a/web/process.php b/web/process.php
index c590bee..de8ea90 100644
--- a/web/process.php
+++ b/web/process.php
@@ -62,6 +62,7 @@
$features = filter_input(INPUT_POST, "features", FILTER_CALLBACK, $sfi);
$keywords = filter_input(INPUT_POST, "keywords", FILTER_CALLBACK, $sfi);
$outputFormat = filter_input(INPUT_POST, "format", FILTER_CALLBACK, $sfi);
+ $email = filter_input(INPUT_POST, "email", FILTER_VALIDATE_EMAIL);
$iniString = "[vmconfig]
@@ -97,10 +98,10 @@ OUTPUT_FORMAT=$outputFormat";
die("Could not connect to database ".mysqli_connect_error());
}
- $query = "INSERT INTO builds (id, handle, ipaddress) ".
- "VALUES(?, ?, ?)";
+ $query = "INSERT INTO builds (id, handle, ipaddress, email) ".
+ "VALUES(?, ?, ?, ?)";
$stmt = $db->prepare($query);
- $stmt->bind_param("sss", $buildID, $handle, $ipaddress);
+ $stmt->bind_param("ssss", $buildID, $handle, $ipaddress, $email);
$stmt->execute();
$stmt->close();
$db->close();