query('SELECT * FROM users'); while ($line = $DatabaseQuery->fetchArray()) { if ($line['username'] == htmlspecialchars($_SESSION['username']) && htmlspecialchars($_SESSION['username']) != "" && $line['password'] == htmlspecialchars($_SESSION['password']) && htmlspecialchars($_SESSION['password']) != "" && $line['usertype'] == 2) { $Authorized = 1; $Primary = $line['primaryadmin']; break; } } // not authorized if ($Authorized != 1) { header('Location: /'); die(); } $html = ""; $html = printHeader($html, 0); $html .= "\t\t\t
ID | \n"; $html .= "\t\t\t\t\t\tPoster | \n"; $html .= "\t\t\t\t\t\tComment date | \n"; $html .= "\t\t\t\t\t\tUser type | \n"; $html .= "\t\t\t\t\t\tPage | \n"; $html .= "\t\t\t\t\t|
---|---|---|---|---|---|
$ID | \n"; $html .= "\t\t\t\t\t\t$Username | \n"; $html .= "\t\t\t\t\t\t$commentDate | \n"; $html .= "\t\t\t\t\t\t$userType | \n"; $html .= "\t\t\t\t\t\t$Page | \n"; $html .= "\t\t\t\t\t\tRemove | \n"; $html .= "\t\t\t\t\t
Invalid user.
\n"; } else if ($Error == "type") { $html .= "\t\t\t\tInvalid type.
\n"; } else if ($Error == "denied") { $html .= "\t\t\t\tYou don't have permission to create a user of this type.
\n"; } else if ($Error == "exists") { $html .= "\t\t\t\tThis user already exists.
\n"; } else if ($Error == "username") { $html .= "\t\t\t\tYou must specify a username.
\n"; } } else if ($Action == "users") { if ($Primary != 1) { $html .= "\t\t\t\tAdministrator users are not visible.
\n"; } $html .= "\t\t\t\tID | \n"; $html .= "\t\t\t\t\t\tUser | \n"; $html .= "\t\t\t\t\t\tComments | \n"; $html .= "\t\t\t\t\t\tLast used | \n"; $html .= "\t\t\t\t\t\tCreated | \n"; $html .= "\t\t\t\t\t\tIP | \n"; $html .= "\t\t\t\t\t\tUser agent | \n"; $html .= "\t\t\t\t\t\tUser type | \n"; $html .= "\t\t\t\t\t||
---|---|---|---|---|---|---|---|---|---|
$ID | \n"; $html .= "\t\t\t\t\t\t$Username | \n"; $html .= "\t\t\t\t\t\t$NumberOfComments | \n"; $html .= "\t\t\t\t\t\t$LastUsed | \n"; $html .= "\t\t\t\t\t\t$Created | \n"; $html .= "\t\t\t\t\t\t$IP | \n"; $html .= "\t\t\t\t\t\t$UserAgent | \n"; $html .= "\t\t\t\t\t\t$userType | \n"; if ($Primary == 1 && $line['primaryadmin'] != 1) { // primary admins cannot be removed $html .= "\t\t\t\t\t\tRemove | \n"; $html .= "\t\t\t\t\t\tEdit | \n"; } $html .= "\t\t\t\t\t