Whenever we display an image for any reason, show the admin block, fixes #621

This commit is contained in:
Shish
2020-03-23 00:06:43 +00:00
parent bfcefb97e7
commit 1fc75c0b18
7 changed files with 19 additions and 15 deletions

View File

@ -9,7 +9,7 @@ class ETServer extends Extension
global $database, $page, $user;
if ($event->page_matches("register.php")) {
error_log("register.php");
if(isset($_POST["data"])) {
if (isset($_POST["data"])) {
$database->execute(
"INSERT INTO registration(data) VALUES(:data)",
["data"=>$_POST["data"]]
@ -17,13 +17,11 @@ class ETServer extends Extension
$page->set_title("Thanks!");
$page->set_heading("Thanks!");
$page->add_block(new Block("Thanks!", "Your data has been recorded~"));
}
elseif ($user->can(Permissions::VIEW_REGISTRATIONS)) {
} elseif ($user->can(Permissions::VIEW_REGISTRATIONS)) {
$page->set_title("Registrations");
$page->set_heading("Registrations");
$n = 0;
foreach($database->get_all("SELECT responded, data FROM registration ORDER BY responded DESC") as $row) {
foreach ($database->get_all("SELECT responded, data FROM registration ORDER BY responded DESC") as $row) {
$page->add_block(new Block(
$row["responded"],
(string)PRE(["style"=>"text-align: left; overflow: scroll;"], $row["data"]),