\n"); print("
\n"); if ($stage == "") { print(""); print("\n"); } else { $newstage = $stage + 1; print(""); if (eregi($action, "delete")) { print("\n"); } else if (eregi($action, "confirm delete")) { print("\n"); } else if (eregi($action, "disable")) { print("\n"); } else if (eregi($action, "confirm disable")) { print("\n"); } else if (eregi($action, "make moderator")) { print("\n"); } else if (eregi($action, "confirm make moderator")) { print("\n"); } else if (eregi($action, "make admin")) { print("\n"); } else if (eregi($action, "confirm make admin")) { print("\n"); } else if (eregi($action, "make user")) { print("\n"); } else if (eregi($action, "confirm make user")) { print("\n"); } } $user_ref = $PHP_SELF . "?order_by=Username"; $mail_ref = $PHP_SELF . "?order_by=EmailAddress"; $name_ref = $PHP_SELF . "?order_by=RealName"; $admn_ref = $PHP_SELF . "?order_by=Admin DESC"; print("\n"); print("\n"); $db_link = SQL_connect(); // form the select statement $statement = "SELECT * FROM users "; if ($order_by != "") { $statement .= "ORDER BY $order_by"; } else { $statement .= "ORDER BY Username"; } // output it... helpful for debugging purposes... //print("

SQL Statement: $statement

"); $db_result = SQL_query($statement, $db_link); // find out how many results there were... $aff_rows = SQL_get_aff_rows($db_link, $db_result); //print("
There are currently $aff_rows categories.

\n"); if ($aff_rows == 0) { print("
List Users
Confirm Delete of Users
Deleting Users
Confirm Disable of Users
Disabling Users
Confirm Moderator Status of Users
New Moderators
Confirm Admin Status of Users
New Admins
Confirm User Status
Users
"); if ($stage == "" || $stage == 1) { print(" "); } print("User NameEmail AddressReal NameAdministrator
No users found in this database... have you created an account for yourself yet?
\n"); SQL_close($db_link); include $inc_dir . "footer.php3"; exit; } // get each row for ($db_rows = 0; $db_rows < $aff_rows; $db_rows++) { $row = SQL_fetch_array($db_result, $db_rows); $user = $row["username"]; $pw = $row["password"]; $admin = $row["admin"]; $email = $row["emailaddress"]; $realname = $row["realname"]; if (($stage >= 1) && ($User[$user] == "on")) { $checked = " CHECKED"; if ($stage == 2) { if (eregi("confirm delete", $action)) { $st = "DELETE FROM users WHERE username=\"$user\""; $res = SQL_query($st, $db_link); //print("SQL: $st\n"); } else if (eregi($action, "confirm disable")) { if (ereg("^\*", $pw)) { print("$user is already disabled.\n"); } else { $pw = "*$pw"; $st = "UPDATE users SET password=\"$pw\" WHERE username=\"$user\""; $res = SQL_query($st, $db_link); //print("SQL: $st\n"); } } else if (eregi($action, "confirm reenable")) { if (!ereg("^\*", $pw)) { print("$user is not currently disabled.\n"); } else { $pw = substr($pw, 1); $st = "UPDATE users SET password=\"$pw\" WHERE username=\"$user\""; $res = SQL_query($st, $db_link); //print("SQL: $st\n"); } } else if (eregi($action, "confirm make moderator")) { if ($admin) { if ($admin == 1) { $admin_str = "an administrator"; } if ($admin == 2) { $admin_str = "a moderator"; } print("$user is currently $admin_str.\n"); } else { $admin = 2; $st = "UPDATE users SET admin=2 WHERE username=\"$user\""; $res = SQL_query($st, $db_link); //print("SQL: $st\n"); } } else if (eregi($action, "confirm make admin")) { if ($admin == 1) { print("$user is currently an administrator.\n"); } else { $admin = 1; $st = "UPDATE users SET admin=$admin WHERE username=\"$user\""; $res = SQL_query($st, $db_link); //print("SQL: $st\n"); } } else if (eregi($action, "confirm make user")) { if ($admin == 0) { print("$user is currently an unpriviledged user.\n"); } else { $admin = 0; $st = "UPDATE users SET admin=$admin WHERE username=\"$user\""; $res = SQL_query($st, $db_link); //print("SQL: $st\n"); } } } } else { $checked = ""; } if ($admin == 1) { $adm_str = "Admin"; } else if ($admin == 2) { $adm_str = "Moderator"; } else { $adm_str = "User"; } if (($stage == "") || (($stage >= 1) && ($User[$user] == "on"))) { print(""); if ($stage == "" || $stage == 1) { print(""); } if (ereg("^\*", $pw)) { $user .= " (Disabled)"; } print("$user\n"); print("$email$realname$adm_str\n"); } } print("\n"); print(""); if ($stage == "") { print(""); print(""); print(""); print("\n"); print("\n"); print("\n"); } if ($stage == 1) { print(""); } print("
\n"); include $inc_dir . "footer.php3"; ?>