Login Registration\n" ."Thank you for requesting an account. You should receive an " ."email from $PROJECT_EMAIL shortly with instructions on " ."completing your registration.
\n"); html_footer(); exit(); } db_free($result); $usererror = "Username already exists!"; } else if ($argc == 1 && $argv[0] == "E" && $username != "" && $password != "" && $register != "") { // Check that we have an existing user account... $name = db_escape($username); $result = db_query("SELECT * FROM users WHERE name='$name'"); if (db_count($result) == 1) { // Yes, now check the registration code... $row = db_next($result); $hash = md5("$row[id]:$row[hash]"); if ($hash == $register) { // Good code, enable the account and login... db_query("UPDATE users SET is_published = 1 WHERE name='$name'"); if (auth_login($username, $password) == "") { db_query("UPDATE users SET is_published = 0 WHERE name='$name'"); $usererror = "Login failed!"; } } else $usererror = "Bad registration code!"; } else $usererror = "Username not found!"; db_free($result); } else if (argc == 0 && $username != "" && $password != "") if (auth_login($username, $password) == "") $usererror = "Login failed!"; } else { $username = ""; $password = ""; $password2 = ""; $email = ""; $register = ""; } if ($LOGIN_USER != "") header("Location: account.php"); else if ($argc == 0 || $argv[0] != "E") { // Header + start of table... html_header("Login"); print("\n");
// Existing users...
print("Current Users\n"); if ($argc == 0 && $usererror != "") print("$usererror \n"); print("If you are a registered $PROJECT_NAME developer, please enter " ."your username and password to login: \n" ."\n"); // Separator... print(" | "
."" ."" ." | " ."\n");
// New users...
print("New Users\n"); if ($argc == 1 && $usererror != "") print("$usererror \n"); $username = htmlspecialchars($username, ENT_QUOTES); $email = htmlspecialchars($email, ENT_QUOTES); print("If you are a not registered $PROJECT_NAME developer, please fill " ."in the form below to register. An email will be sent to the " ."address you supply to confirm the registration: \n" ."\n"); // End table print(" |
$usererror
\n"); $username = htmlspecialchars($username, ENT_QUOTES); $register = htmlspecialchars($register, ENT_QUOTES); print("Please enter the registration code that was emailed to you " ."with your username and password to enable your account and login:
\n" ."\n"); html_footer(); } // // End of "$Id: login.php,v 1.3 2004/05/20 21:37:57 mike Exp $". // ?>