2005-01-19 05:44:12 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once("../inc/db.inc");
|
2005-02-25 00:41:22 +00:00
|
|
|
require_once("../inc/xml.inc");
|
2005-01-19 05:44:12 +00:00
|
|
|
|
|
|
|
db_init();
|
|
|
|
|
2005-02-25 00:41:22 +00:00
|
|
|
$nonce = process_user_text($_GET["nonce"]);
|
|
|
|
$email_addr = process_user_text($_GET["email_addr"]);
|
|
|
|
|
|
|
|
xml_header();
|
|
|
|
|
|
|
|
function reply($x) {
|
|
|
|
echo "<am_create_reply>
|
|
|
|
$x
|
|
|
|
</am_create_reply>
|
|
|
|
";
|
|
|
|
exit();
|
|
|
|
}
|
|
|
|
|
|
|
|
function error($x) {
|
|
|
|
reply("<error>$x</error>");
|
|
|
|
}
|
|
|
|
|
|
|
|
function success() {
|
|
|
|
reply("<success/>");
|
|
|
|
}
|
2005-01-19 05:44:12 +00:00
|
|
|
|
|
|
|
if (strlen($nonce)==0) {
|
2005-02-25 00:41:22 +00:00
|
|
|
error("missing nonce ID");
|
2005-01-19 05:44:12 +00:00
|
|
|
}
|
|
|
|
if (strlen($email_addr)==0) {
|
2005-02-25 00:41:22 +00:00
|
|
|
error("missing email addr");
|
|
|
|
}
|
|
|
|
|
|
|
|
$config = get_config();
|
|
|
|
if (parse_bool($config, "disable_account_creation")) {
|
|
|
|
error("account creation disabled");
|
2005-01-19 05:44:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
$result = mysql_query(
|
|
|
|
"insert into tentative_user (nonce, email_addr, confirmed) values ('$nonce', '$email_addr', 0)"
|
|
|
|
);
|
|
|
|
|
|
|
|
if ($result) {
|
|
|
|
$subject = "Confirm ".PROJECT." account";
|
|
|
|
$body = "Click to confirm account:
|
|
|
|
".URL_BASE."am_confirm.php?nonce=$nonce
|
|
|
|
";
|
|
|
|
$headers = "";
|
|
|
|
mail($email_addr, $subject, $body, $headers);
|
2005-02-25 00:41:22 +00:00
|
|
|
success();
|
2005-01-19 05:44:12 +00:00
|
|
|
} else {
|
2005-02-25 00:41:22 +00:00
|
|
|
error("database error");
|
2005-01-19 05:44:12 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
?>
|