\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: $page"); else if ($argc == 0 || $argv[0] != "E") { // Header + start of table... html_header("Login"); print("\n" ."" ."" ."\n" ."
\n"); // Existing users... print("

Current Users

\n"); if ($argc == 0 && $usererror != "") print("

$usererror

\n"); $page = htmlspecialchars($page, ENT_QUOTES); print("

If you are a registered $PROJECT_NAME developer, please enter " ."your username and password to login:

\n" ."
" ."" ."\n" ."" ."\n" ."" ."\n" ."\n" ."
Username:
Password:" ."
\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" ."" ."\n" ."" ."\n" ."" ."\n" ."" ."\n" ."\n" ."
Username:
EMail:
Password:" ."
Password Again:" ."
\n"); // End table print("
\n"); html_footer(); } else { html_header("Enable Account"); if ($usererror != NULL) 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" ."" ."\n" ."" ."\n" ."" ."\n" ."\n" ."
Registration Code:" ."
Username:
Password:" ."
\n"); html_footer(); } // // End of "$Id$". // ?>