setUsername($_POST['username']);
$acc->setPassword($_POST['password1']);
$acc->setEMail($_POST['email']);
$acc->setGender($_POST['gender']);
$val = $acc->validate();
if (is_array($val))
{
foreach( $val as $error)
{
$err .= $error . "
";
}
$showform = true;
}
if ($_POST['password2'] != $_POST['password1'])
{
$err .= "The given passwords don't match!"; $showform = true;
}
if (TMWAccount::existsUsername( $_POST['username'] ))
{
$err .= "The username is in use!"; $showform = true;
}
if ($enable_captcha)
{
// check captcha
$resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"],
$_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid)
{
$err .= "The captcha was incorrect!"; $showform = true;
}
}
if (!$showform)
{
// create the account
if (!$acc->storeAccount())
{
$err = "The was an unknown error while storing your new account";
$showform = true;
}
}
}
include("includes/common.php");
placeHeader("Registration");
if ($showform)
{
?>
With this form you can register for a new account.
Your was scheduled for creation! In a few minutes you should receive an email with verification of your new account.