"); // Redirect Redirect("login.php?op=login&msg=" . urlencode("Registration e-mail resent to $email.")); } function register_verify() { // Verification (activation) of a login $email = $_GET['email']; $unique = $_GET['unique']; if ($unique == "" || $email == "") ErrorOut("You must provide a unique key and an e-mail address to continue."); $user_id = DBRetrieve("user_id", "td_users", "user_email='$email' AND user_actcode='$unique'"); if ($user_id === false) ErrorOut("Invalid. Verification failure."); // Update user datatable $dbconn = dbInit(); $dbconn->Execute("UPDATE td_users SET user_active=1, user_actcode='' WHERE user_id=$user_id"); LogActionEx("REGISTER_ACTIVATE", "User $email ($user_id) has been successfully activated."); // Display message PrintHeader("Account Activated"); echo "Your account was successfully activated. Thanks for choosing TorqueDev."; PrintFooter(); } function register_step5() { // Complete final registration $email = trim($_POST['email']); $passwd = sha1(trim($_POST['passwd'])); $name = trim($_POST['fullname']); $own_tge = (($_POST['own_tge'] == "1") ? true : false); $own_tse = (($_POST['own_tse'] == "1") ? true : false); $own_t2d = (($_POST['own_t2d'] == "1") ? true : false); if ($own_tge && ($_SESSION['has_tge'] == true)) $do_tge = "1"; else $do_tge = "0"; if ($own_tse && ($_SESSION['has_tse'] == true)) $do_tse = "1"; else $do_tse = "0"; if ($own_t2d && ($_SESSION['has_t2d'] == true)) $do_t2d = "1"; else $do_t2d = "0"; if ($email == "" || $passwd == "") // || ($own_tge == false && $own_tse == false && $own_t2d == false)) ErrorOut("Error: You must fill in an e-mail address and password"); //, and check at least one product that you own."); if (UserExists($email)) ErrorOut("That user is already registered with the system."); // Format name if ($name == "") $name = "User"; // Create a new user entry $unique = uniqid(); $dbconn = dbInit(); $dbconn->Execute("INSERT INTO td_users (user_email, user_password, user_fullname, user_tge, user_tse, user_t2d, user_active, user_actcode) VALUES ('$email', '$passwd', '$name', $do_tge, $do_tse, $do_t2d, 0, '$unique')"); // Send an e-mail their way $mail_body = "Greetings" . (($name == "User") ? "!" : " $name,") . "\n\nI'd like to personally thank you for making TorqueDev your IDE of choice. I know that you have more than one option when it comes to development environments, and I'm thrilled that you chose ours.\n\nThis e-mail is your activation message. Just go ahead and click the link below to activate your account, and you'll be well on your way to developing your projects more quickly and with greater efficiency.\n\nhttp://www.torquedev.com/network/register.php?op=auth_verify&unique=$unique&email=$email\n\n\nThank you,\nSam Bacsa"; mail($email, "[TorqueDev] Network Registration", $mail_body, "From: TorqueDev "); // Destroy the session session_destroy(); PrintHeader("Registration Complete"); echo "Registration has been successfully completed on your account. You should receive an e-mail in a matter of minutes. You may then use the link in that e-mail to activate your account and begin using the network as well as the IDE.

"; LogActionEx("REGISTER_ACCOUNT", "User $email ($name) has registered an account with flags $do_tge $do_tse $do_t2d"); PrintFooter(); } function register_step4() { // Verify the local install(s) $email = trim($_POST['email']); $passwd = trim($_POST['passwd']); $name = stripslashes(trim($_POST['fullname'])); $verify_tge = strtolower(str_replace(" ", "", str_replace("\t", "", $_POST['verify_0']))); $verify_tse = strtolower(str_replace(" ", "", str_replace("\t", "", $_POST['verify_1']))); $verify_t2d = strtolower(str_replace(" ", "", str_replace("\t", "", $_POST['verify_2']))); $own_tge = (($_POST['own_tge'] == "1") ? true : false); $own_tse = (($_POST['own_tse'] == "1") ? true : false); $own_t2d = (($_POST['own_t2d'] == "1") ? true : false); PrintHeader("Network Registration - Step 4"); //print_r($_SESSION['AUTH_2']); $didfail = false; // Verify the individual installs if ($own_tge && ($_SESSION['has_tge'] != true)) { if ($verify_tge != $_SESSION['AUTH_0']['text']) { $didfail = true; echo "TGE Verification: FAILED
"; } else { $_SESSION['has_tge'] = true; echo "TGE Verification: Succeeded
"; } } else { if ($own_tge) { echo "TGE Verification: Previously Succeeded
"; } } if ($own_tse && ($_SESSION['has_tse'] != true)) { if ($verify_tse != $_SESSION['AUTH_1']['text']) { $didfail = true; echo "TSE Verification: FAILED
"; } else { $_SESSION['has_tse'] = true; echo "TSE Verification: Succeeded
"; } } else { if ($own_tse) { echo "TSE Verification: Previously Succeeded
"; } } if ($own_t2d && ($_SESSION['has_t2d'] != true)) { if ($verify_t2d != $_SESSION['AUTH_2']['text']) { $didfail = true; echo "T2D Verification: FAILED
"; } else { $_SESSION['has_t2d'] = true; echo "T2D Verification: Succeeded
"; } } else { if ($own_t2d) { echo "T2D Verification: Previously Succeeded
"; } } echo ""; // Check if the user failx0r3d! if ($didfail) { // We've failed -- go ahead and notify them and give them the option of going back to the previous page echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; } else { // Display their final data echo ""; } echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "


One or more verification operations have failed. You may try those specific verifications over again or skip them completely.


Verification successfully completed. Please verify your submitted data for accuracy and then click \"Continue\" to complete your registration.

"; echo "E-Mail Address: $email

"; PrintFooter(); } function register_step3() { // Step 3 of Registration $email = trim($_POST['email']); $passwd = trim($_POST['passwd']); $passwd2 = trim($_POST['passwd2']); $name = stripslashes(trim($_POST['fullname'])); $own_tge = (($_POST['own_tge'] == "1") ? true : false); $own_tse = (($_POST['own_tse'] == "1") ? true : false); $own_t2d = (($_POST['own_t2d'] == "1") ? true : false); if ($email == "" || $passwd == "" || $passwd2 == "" || ($own_tge == false && $own_tse == false && $own_t2d == false)) ErrorOut("Error: You must fill in an e-mail address and password, and check at least one product that you own."); // Check existence of email if (UserExists($email)) ErrorOut("That e-mail is already registered with the system."); // Verify password length and complexity if (strlen($passwd) < 6 || strlen($passwd) > 32) ErrorOut("Passwords must be at least 6 characters long but no more than 32."); if ($passwd != $passwd2) ErrorOut("Passwords do not match."); // Verify e-mail address validity if (!VerifyEmailFormat($email)) ErrorOut("E-Mail address is not in the correct format"); // Begin the verification phase by randomly choosing a file from each type and storing it in // the session $dbconn = dbInit(); PrintHeader("Network Registration - Step 3"); echo "You will now be asked to verify the ownership of the game engines you have selected by cutting and pasting a line of code from the C++ source of the engine(s). Please omit any pre- and post-line whitespace including tabs and the space character.

"; echo "
"; echo ""; if ($own_tge && ($_SESSION['has_tge'] != true)) PickAndStore(0); if ($own_tse && ($_SESSION['has_tse'] != true)) PickAndStore(1); if ($own_t2d && ($_SESSION['has_t2d'] != true)) PickAndStore(2); echo "
"; echo "
"; $passwd = sha1($passwd); echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
"; PrintFooter(); } function register_step2() { // Step 2 session_destroy(); PrintHeader("Network Registration - Step 2"); echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
E-Mail Address:
Password:
Verify Password:
Full Name: * Optional
Product(s) Owned:
* Optional
"; echo " Torque Game Engine
"; echo " Torque Shader Engine
"; echo " Torque 2D"; echo "
\">
"; echo "
"; PrintFooter(); } function register_main() { // Registration main page PrintHeader("Network Registration - Step 1"); echo "

THIS AREA IS NO LONGER NECESSARY UNLESS YOU ARE INSTALLING A LEGACY VERSION OF TORQUEDEV (< 1.2 DELTA 7). IF YOU ARE DOWNLOADING A FINAL RELEASE YOU DO NOT HAVE TO GO THROUGH THIS PROCESS SO PLEASE SKIP IT. WE ARE KEEPING THIS HERE BECAUSE SOME PEOPLE PREFER TO UES THE OLDER VERSIONS AND WE DON'T WANT TO STOP THEM FROM BEING ABLE TO.

"; echo "

"; echo "Due to the nature of TorqueDev and the Garage Games End User License Agreement (EULA) for the Torque engines, certain content must be restricted to game owners only. Because of this restriction, a special verification must be performed before you can gain access to restricted content.

"; echo "


"; echo "

How Does It Work?

"; echo "You will be prompted for your e-mail address, password, and full name. The e-mail address must be valid, as you will be required to verify it. The name field is optional. You will also be asked what game engine(s) you have a license to. At the next step, you will be asked to cut and paste a line of code from the engine source. The engine source used is the stock installers available on Garage Games (NOT the CVS). This step is necessary to verify your ownership of the engine.


"; echo "

How Does the IDE Use This Information?

"; echo "When you first run TorqueDev, you will be prompted for your network e-mail and password. TorqueDev will verify the credentials provided with the website. This check happens once every thirty days, in case a license is terminated by Garage Games.


"; echo "

I'm Concerned With the Safety of My Information

"; echo "The TorqueDev team and netMercs guarantees the safety of your registration information. The information you share with us will not in any way be given out, sold, or provided in any way, shape, or form to any third party. Additionally, no personally identifiable information is transmitted from your computer at any time. The only thing that is transmitted is your e-mail address, network password, and unique machine hash.


"; echo "

What is the Unique Machine Hash?

"; echo "The unique machine hash, aka \"machine code\" or \"site key\" is the message digest of various bits of hardware identifiers in your system, including ethernet MAC address, hard disk serial number, and the like. These bits of information are then placed together and run through a cryptographic hash function -- a form of irreversible one-way encryption.


"; echo "

What Do You Use the Unique Machine Hash For?

"; echo "The machine hash is used during ownership authentication to ensure that usernames and passwords were not given out and then used to authorize multiple systems, as access to EULA-restricted information must remain in hands of Garage Games licensees.


"; echo "

Does This Mean That I Can Only Authorize One Machine?

"; echo "Not at all. You can use your e-mail and password to authorize twelve computers before contacting us. If you need to authorize more than twleve computers, feel free to e-mail us and we will be happy to accommodate your needs. Remember, the goal of this system is not to restrict use of the software; rather, it is to keep non-GG license holders from using the editor and gaining access to licensed content.


"; echo "

I Have More Questions!

"; echo "We're happy to hear them. You can either drop us a line or post on our forums.


"; echo "
"; PrintFooter(); } ?> Execute("SELECT verify_id, verify_file, verify_file_text FROM td_verify WHERE verify_platform=$gametype ORDER BY RAND() LIMIT 1"); if ($result->EOF) die("Critical failure retrieving verification information. ($gametype)"); list($id, $file, $text) = $result->fields; $text_lines = explode("\r\n", $text); $picked_line = ""; // Pick a random line from the thingy while((substr($picked_line, 0, 2) == "//") || ($picked_line == "") || ($picked_line == "}") || ($picked_line == "{")) { $picked_line_num = rand(0, count($text_lines) - 1); $picked_line = $text_lines[$picked_line_num]; $picked_line = strtolower(str_replace(" ", "", $picked_line)); $picked_line = str_replace("\t", "", $picked_line); } $_SESSION["AUTH_$gametype"] = array("file" => $id, "line" => $picked_line_num+1, "text" => $picked_line); echo "Please enter the text on line " . ($picked_line_num + 1) . " of $file for " . FromGameType($gametype) . ":"; echo "

"; } ?>