Dragon-Knight/server/modules/HomeModule.php

26 lines
507 B
PHP
Raw Normal View History

2024-07-11 18:17:51 -05:00
<?php
class HomeModule
{
public static function handle()
{
return self::home();
}
2024-07-11 20:47:39 -05:00
public static function home()
2024-07-11 18:17:51 -05:00
{
foreach (($_SESSION['flash'] ?? []) as $key => $value) {
2024-07-17 18:41:34 -05:00
echo '<div class="alert ' . $key . '">- ' . $value . '</div>';
}
if (App::auth()) {
echo 'You are already logged in!<br>';
2024-07-17 18:41:34 -05:00
echo '<form action="/gate/logout" method="post"><button>Logout</button></form>';
} else {
echo 'You are not logged in!<br>';
}
2024-07-11 20:47:39 -05:00
echo 'Your request is: ' . App::$req->uri(0);
2024-07-11 18:17:51 -05:00
}
}