示例#1
0
 if ($_POST['user_pass'] == '') {
     $error['user_pass'] = '******';
 }
 if ($_POST['user_pass'] == '') {
     $error['user_pass'] .= '<div class="error">You must type verify your password</div>';
 }
 if (strlen($_POST['user_pass']) < 6 or strlen($_POST['user_pass']) > 35) {
     $error['user_pass'] .= '<div class="error">Your passwords must be at least 6 characters long</div>';
 }
 if ($_POST['user_pass'] != $_POST['verify_user_pass']) {
     $error['user_pass'] .= '<div class="error">Your passwords did not match, please try again</div>';
 }
 //if no error occured, lets create the user account
 if (!$error) {
     //no error, so now setup all of the mysql database structures
     INSTALL::install_databases();
     $mysql['user_email'] = $db->real_escape_string($_POST['user_email']);
     $mysql['user_name'] = $db->real_escape_string($_POST['user_name']);
     $mysql['user_timezone'] = $db->real_escape_string($_POST['user_timezone']);
     $mysql['user_time_register'] = $db->real_escape_string(time());
     //md5 the user pass with salt
     $user_pass = salt_user_pass($_POST['user_pass']);
     $mysql['user_pass'] = $db->real_escape_string($user_pass);
     $hash = md5(uniqid(rand(), TRUE));
     $user_hash = intercomHash($hash);
     //insert this user
     $user_sql = "  \tINSERT INTO \t202_users\n\t\t\t\t\t    \tSET\t\t\t\tuser_email='" . $mysql['user_email'] . "',\n\t\t\t\t\t    \t\t \t\t\tuser_name='" . $mysql['user_name'] . "',\n\t\t\t\t\t    \t\t\t\t\tuser_pass='******'user_pass'] . "',\n\t\t\t\t\t    \t\t\t\t\tuser_timezone='" . $mysql['user_timezone'] . "',\n\t\t\t\t\t    \t\t\t\t\tuser_time_register='" . $mysql['user_time_register'] . "',\n\t\t\t\t\t    \t\t\t\t\tinstall_hash='" . $hash . "',\n\t\t\t\t\t    \t\t\t\t\tuser_hash='" . $user_hash . "'";
     $user_result = _mysqli_query($user_sql);
     $user_id = $db->insert_id;
     $mysql['user_id'] = $db->real_escape_string($user_id);
     //update user preference table