query('SELECT * FROM users'); // check permissions while ($line = $DatabaseQuery->fetchArray()) { if ($ID == -1 && $line['username'] == $Username && $Username != "" && $line['password'] != "" && $Password == $line['password']) { $ID = $line['id']; $SelUsername = $line['username']; $IsCurrentUser = true; $Authorized = 1; break; } else if ($line['username'] == $Username && $Username != "" && $line['password'] != "" && $Password == $line['password'] && $line['usertype'] == 2) { // We're logged into an admin account $UserDatabaseQuery = $Database->query('SELECT * FROM users'); $Primary = $line['primaryadmin']; $IsCurrentUser = false; // no need to display admin tools for our own account if ($ID == $line['id']) { $IsCurrentUser = true; } while ($uline = $UserDatabaseQuery->fetchArray()) { if ($ID == $uline['id'] && ($Primary && $uline['usertype'] == 2 || $uline['usertype'] != 2)) { $SelUsername = $uline['username']; $Authorized = 1; break; } } } } if ($Authorized == 0) { die(); } if (isset($_REQUEST['e'])) { $Error = htmlspecialchars($_REQUEST['e']); } $html .= "\t\t\t
This is where you can change account options.
\n"; if ($allowPasswordChange || $IsCurrentUser) { $html .= "\t\t\t\tIf you need to change your password, you can do so here:
\n"; $html .= "\t\t\t\t\t\n"; // handle errors if ($Error == "pnone") { $html .= "\t\t\t\tNo password specified.
\n"; } else if ($Error == "pmismatch") { $html .= "\t\t\t\tPasswords do not match.
\n"; } else if ($Error == "pauth") { $html .= "\t\t\t\tIncorrect password.
\n"; } } if ($allowUsernameChange || !$IsCurrentUser) { $html .= "\t\t\t\tIf you need to change your username, you can do so here:
\n"; $html .= "\t\t\t\t\t\n"; // handle errors if ($Error == "unone") { $html .= "\t\t\t\tNo username specified.
\n"; } else if ($Error == "ucurrent") { $html .= "\t\t\t\tYou must specify your current username.
\n"; } else if ($Error == "umismatch") { $html .= "\t\t\t\tUsernames do not match.
\n"; } else if ($Error == "uexists") { $html .= "\t\t\t\tA user by that name already exists. Sorry.
\n"; } } if (!$IsCurrentUser) { $html .= "\t\t\t\tIf you need to change the type, you can do so here:
\n"; $html .= "\t\t\t\t\t\n"; } // handle errors if ($Error == "auth") { $html .= "\t\t\t\tInvalid username or password.
\n"; } else if ($Error == "action") { $html .= "\t\t\t\tInvalid action.
\n"; } $html = printFooter($html); print "$html"; ?>