header(); $ui->template_open(); $ui->message("Create an Account", "Fill out the form below to create your user account. The information you provide will never be used for any purpose other than keeping track of the uptime data you submit. None of this information will ever be sold or given to any third party, and we will never ever send you spam. We promise."); ?>

Username:

Email Address:

Password:

Password (again):

template_close(); $ui->footer(); break; case "newuser": $ui->header(); $ui->template_open(); // Simple data validation if (trim($_POST["user"]) == "" || trim($_POST["pass"]) == "" || trim($_POST["pass2"]) == "" || trim($_POST["email"]) == "") { $ui->message("Looks like you missed something...", "You didn't finish filling out the form, goofball. Go back and try again."); $ui->template_close(); $ui->footer(); exit; } if (ereg("[<>'\"]", $_POST["user"])) { $ui->message("Invalid Username", "The username ".sh($_POST["user"])." contains invalid characters. Please try another one."); $ui->template_close(); $ui->footer(); exit; } if (ereg("['\"]", $_POST["pass"])) { $ui->message("Invalid Password", "The password you chose contains invalid characters. Please choose another one."); $ui->template_close(); $ui->footer(); exit; } if ($_POST["pass"] != $_POST["pass2"]) { $ui->message("Mismatched Passwords", "Your passwords don't match. Go back and try again."); $ui->template_close(); $ui->footer(); exit; } if (!ereg("^([a-zA-Z0-9_.-]+)@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.)|(([a-zA-Z0-9\\-]+\\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\\]?)$", $_POST["email"])) { $ui->message("Invalid Email Address", "That looks like a fake email address to me. Go back and try again, cowboy."); $ui->template_close(); $ui->footer(); exit; } // Now we get to the fun stuff... $test = get_userinfo(trim($_POST["user"])); if ($test->id > 0) { // User already exists $ui->message("Duplicate Username", "There is already a user with the name ".trim(sh($_POST["user"])).". Please try another one."); $ui->template_close(); $ui->footer(); } else { // Yay! Create the account. addNewUser(trim($_POST["user"]), $_POST["pass"], trim($_POST["email"])); $ui->message("Account Created", "Your user account has been created. You can now login with the username and password you chose. Have fun!"); $ui->template_close(); $ui->footer(); } break; default: echo "Wow. You certainly should never see this. Something must have gone horribly wrong."; break; } ?>