} if ($password) { $passlength = strlen($password); if ($passlength < 4) { $errorstring .= "Sorry, your password must be at least 4 characters.<br />\n"; } } else { $errorstring .= "You must provide a password!<br />\n"; } if (isset($_POST['email']) && strlen($email)) { /* Check if valid email address */ if (!validateemail($email)) { // Provided in common.php $errorstring .= "You must provide a valid email address!<br />\n"; } if ($db->emailexists($email) == true) { $errorstring .= "That email has already been used to register an account!<br />\n"; } } else { $errorstring .= "You must provide an email address!<br />\n"; } if ($errorstring == "") { // No errors encountered so far, attempt to register if (THprofile_regpolicy == 1) { $initial_status = 0; // pending admin approval } else { $initial_status = 1; // automatically approved } $actionstring = "Register\tname:" . $username;
if ($password) { $passlength = strlen($password); if ($passlength < 4) { $errorstring .= "Sorry, your password must be at least 4 characters.<br />\n"; } } else { $errorstring .= "You must provide a password!<br />\n"; } // Email validation if (isset($_POST['email']) && strlen($email)) { /* Check if valid email address */ if (!validateemail($email)) { $errorstring .= "You must provide a valid email address!<br />\n"; } // Check if it exists already if ($profile_dbi->emailexists($email) == true) { $errorstring .= "That email has already been used to register an account!<br />\n"; } } else { $errorstring .= "You must provide an email address!<br />\n"; } // No errors encountered so far, attempt to register if ($errorstring == "") { // Insert them, with approval from the beginning (hence the 1 at the end) $profile_dbi->registeruser($username, $password, THprofile_userlevel, $email, 1); $actionstring = "Add user\tname:" . $username; writelog($actionstring, "admin"); //header("Location: ".THurl."admin.php?a=p"); //Forward them to the newly created profile - this will hopefully get rid of confusion on whether or not the profile was created. header("Location: " . THurl . "profiles.php?action=viewprofile&user=" . $username); }