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

Account options

\n"; $html .= "\t\t\t\t

This is where you can change account options.

\n"; if ($allowPasswordChange || $IsCurrentUser) { $html .= "\t\t\t\t

Change password

\n"; $html .= "\t\t\t\t\t

If you need to change your password, you can do so here:

\n"; $html .= "\t\t\t\t\t
\n"; if ($IsCurrentUser) { $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; } $html .= "\t\t\t\t\t\t

\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t

\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t

\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t
\n"; // handle errors if ($Error == "pnone") { $html .= "\t\t\t\t

No password specified.

\n"; } else if ($Error == "pmismatch") { $html .= "\t\t\t\t

Passwords do not match.

\n"; } else if ($Error == "pauth") { $html .= "\t\t\t\t

Incorrect password.

\n"; } } if ($allowUsernameChange || !$IsCurrentUser) { $html .= "\t\t\t\t

Change username

\n"; $html .= "\t\t\t\t\t

If you need to change your username, you can do so here:

\n"; $html .= "\t\t\t\t\t
\n"; if ($IsCurrentUser) { $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t

\n"; } $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t

\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t
\n"; // handle errors if ($Error == "unone") { $html .= "\t\t\t\t

No username specified.

\n"; } else if ($Error == "ucurrent") { $html .= "\t\t\t\t

You must specify your current username.

\n"; } else if ($Error == "umismatch") { $html .= "\t\t\t\t

Usernames do not match.

\n"; } else if ($Error == "uexists") { $html .= "\t\t\t\t

A user by that name already exists. Sorry.

\n"; } } if (!$IsCurrentUser) { $html .= "\t\t\t\t

Administrator: Change type

\n"; $html .= "\t\t\t\t\t

If you need to change the type, you can do so here:

\n"; $html .= "\t\t\t\t\t
\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t

\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t\t\n"; $html .= "\t\t\t\t\t
\n"; } // handle errors if ($Error == "auth") { $html .= "\t\t\t\t

Invalid username or password.

\n"; } else if ($Error == "action") { $html .= "\t\t\t\t

Invalid action.

\n"; } $html = printFooter($html); print "$html"; ?>