From 61d1aa04d8d44b17bfe6dace90088669fc6c3df8 Mon Sep 17 00:00:00 2001 From: Kyle McFarland Date: Wed, 31 Jan 2018 00:51:07 -0600 Subject: Initial import * Registration system's almost done * Just part way through implementing tasks So not much done yet, but it's a start. --- validate.php | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 validate.php (limited to 'validate.php') diff --git a/validate.php b/validate.php new file mode 100644 index 0000000..26fc67d --- /dev/null +++ b/validate.php @@ -0,0 +1,40 @@ +validation_code == $_GET["vcode"]) { + $st = $db->conn->prepare("UPDATE members SET validated=true WHERE userid = ?"); + $success = $st->execute(array($m->userid)); + if ($success) { + $success_alerts[] = 'Successfully validated your email address, Continue'; + } else { + $einfo = $st->errorInfo(); + error_log("mcoop: validate.php failed updating members: " . var_export($einfo, true) . " ($m->userid)"); + $danger_alerts[] = "Failed to update the database to validate your email address, this is an internal error, please contact the admin"; + } + } else { + $danger_alerts[] = "Unable to validate email: incorrect validation code"; + } + } catch (UnknownMember $un) { + $danger_alerts[] = "Unable to validate email: no such user"; + } +} + +echo $twig->render("validate.tmpl", array( + "danger_alerts" => $danger_alerts, + "success_alerts" => $success_alerts, + "sess_info" => $sess_info, + "vattempted" => $vattempted +)); + +?> -- cgit v1.1