Documentation is available at confirm_account.php
- <?php
- /**
- * Confirm Account.
- *
- * As the final step in the new user sign up process
- * the user follows a link from an autogenerated email with
- * a custom hash. When they arrive here they log in again,
- * proving that they control the email address they entered and
- * that they know their own password.
- *
- * This file is part of CompInaBox.
- * @copyright Copyright 2001-2005. Eric D. Nielsen, All rights reserverd.
- * @license http://opensource.org/licenses/gpl-license.php GNU Public License
- * @author Eric D. Nielsen <nielsene@alum.mit.edu>
- *
- * @package WebPages
- * @subpackage UserAccounts
- */
- /**
- * Include all other needed include files.
- */
- include("include_others.inc");
- if (isset($user)) localRedirect("$CIB_BASE_URL");
- sleep(1);
- $hash=$_GET["hash"];
- $query = "SELECT * FROM user_hashes WHERE hash='$hash';";
- $result = $db->query($query);
- if (!$result->numrows())
- {
- sleep(2);
- die ("Please double-check the url, the hash value is incorrect.");
- }
- session_register("hash");
- $username_msg = $_SESSION["username_msg"];
- if ($username_msg!="")
- $username_msg = "<br /><font color=\"red\">$username_msg</font>";
- $password_msg = $_SESSION["password_msg"];
- if ($password_msg!="")
- $password_msg = "<br /><font color=\"red\">$password_msg</font>";
- $challenge = $_SESSION["challenge"];
- $username = $_SESSION["username"];
- $nonce = $_SESSION["nonce"];
- if ($challenge!="" || $username!="" || $nonce!="")
- {
- $testChallenge = MD5(session_id() .$username. $email . $nonce);
- if ($testChallenge!=$challenge)
- {
- # $logger->post("Intrusion","Session Hijack attempt at ".date()."IP:$clientIP user: $userID");
- sleep(2);
- unset($security_userName);
- session_unregister("security_userName");
- unset($challenge); unset($username);
- session_unregister("challenge"); session_unregister("username");
- localRedirect("Location: $CIB_BASE_URL/");
- exit;
- }
- }
- $display = new CIB_Display($db);
- $page = $display->beginPage("CompInaBox",
- "Account Comfirmation");
- $form = $display->addTextElement("username",$username,$username_msg,"Username","Please enter the username you
- selected during account creation.",20);
- $form .= $display->addPasswordElement("pasword",$password,$password_msg,"Password","Please enter the password you
- selected during account creation.",20);
- $form .=$display->addSubmitButton("Activate My Account");
- $page .=$display->wrapForm($form,"SCRIPTS/activate_account.php","post","Account Activation");
- $page .= $display->endPage();
- echo $page;
- ?>
Documentation generated on Tue, 25 Apr 2006 13:00:42 -0400 by phpDocumentor 1.3.0RC3