21) { $s1 = chr($s1 + 69); } else if ($s1 > 14) { $s1 = chr($s1 + 44); } else { $s1 = chr($s1 + 33); } } } else { $j++; $s = rand(0,26); list ($s1) = split("\.", $s, 1); if ($j % 2) { $s1 = chr($s1 + 65); } else { $s1 = chr($s1 + 97); } } $random_pw .= $s1; } } print("
\n"); print("\n"); if ($new_user == "") { print("
Creating New User Account
Blank username, click back and try again.
\n"); include $inc_dir . "footer.php3"; exit; } else if (eregi($user_regex, $new_user)) { print("Username contains invalid characters, please click back and try again.\n"); include $inc_dir . "footer.php3"; exit; } else { print("Username$new_user\n"); } if ($new_email == "") { print("Blank email address, click back and try again.\n"); include $inc_dir . "footer.php3"; exit; } else { if (valid_email($new_email)) { print("Email Address$new_email\n"); } else { print("Invalid email address, click back and try again. Reported to $site_admin for verification in case this in error.\n"); include $inc_dir . "footer.php3"; $subject = "[phpBoard] New Account Invalid Email"; $xMailer = "X-Mailer: PHP3 Mailer Tool v.1.0\n"; $xLoop = "X-Loop: phpBoard $site_name\n"; $mailfrom = "From: $site_admin <$site_email>\n"; $mailbcc = "Bcc: $site_email"; $message = "Invalid email suggested:\n"; $message .= " $new_email\n"; $hdrs = $mailfrom . $xMailer . $xLoop . $mailbcc; mail($mailto, $subject, $message, $hdrs); exit; } } if ($new_real == "") { print("Blank real name, click back and try again.\n"); include $inc_dir . "footer.php3"; exit; } else { print("Real Name$new_real\n"); } if (!$signup_requires_confirmation) { if ($new_pass == "") { print("Blank password, click back and try again.\n"); include $inc_dir . "footer.php3"; exit; } if ($new_pass != $new_pass1) { print("Password mismatch, click back and try again.\n"); include $inc_dir . "footer.php3"; exit; } $len = strlen($new_pass); $str = ""; for ($i = 0; $i < $len; $i++) { $str .= "*"; } print("Password$str\n"); $subject = "[phpBoard] New User Notification"; $xMailer = "X-Mailer: PHP3 Mailer Tool v.1.0\n"; $xLoop = "X-Loop: phpBoard $site_name\n"; $mailfrom = "From: $site_admin <$site_email>\n"; $mailbcc = "Bcc: $site_email"; $message = "Pertinent information is as follows:\n"; $message .= "User Name : $new_user\n"; //$message .= "Password : $new_pass\n"; $message .= "Email Address : $new_email\n"; $message .= "Real Name : $new_real\n"; $message .= "\n"; $hdrs = $mailfrom . $xMailer . $xLoop . $mailbcc; $pw_to_add = make_pw($new_pass); } else { $pw = $random_pw; $pw = ereg_replace("<", "<", $pw); $pw = ereg_replace(">", ">", $pw); print("Password$pw\n"); $subject = "[phpBoard] New User Confirmation"; $xMailer = "X-Mailer: PHP3 Mailer Tool v.1.0\n"; $xLoop = "X-Loop: phpBoard $site_name\n"; $mailfrom = "From: $site_admin <$site_email>\n"; $mailbcc = "Bcc: $site_email, $new_email"; $message = "Welcome! Someone, possibly you, has requested an account on The Linux\n"; $message .= "Community's message board system (phpBoard).\n"; $message .= "\n"; $message .= "Pertinent information is as follows:\n"; $message .= "User Name: $new_user\n"; $message .= "Password : $random_pw\n"; $message .= "Real Name: $new_real\n"; $message .= "\n"; $message .= "You can access your account at:\n"; $message .= "$site_url/login." . $ext . "\n"; $message .= "\n"; $message .= "Please feel free to email us if you have any problems.\n"; $message .= "\n"; $hdrs = $mailfrom . $xMailer . $xLoop . $mailbcc; $pw_to_add = make_pw($random_pw); } $statement = "INSERT INTO $user_table_name ($user_account_field, $passwd_field, $admin_field, $email_field, $user_name_field, $image_field) VALUES ('$new_user', '$pw_to_add', 0, '$new_email', '$new_real', '$new_img')"; $res = SQL_query($statement, $db_link); $aff_rows = SQL_get_aff_rows($db_link, $res); // mail is down here so emails are only send if there were no errors. mail($mailto, $subject, $message, $hdrs); print("
\n"); include $inc_dir . "footer.php3"; ?>