26 lines
507 B
PHP
26 lines
507 B
PHP
<?php
|
|
|
|
class HomeModule
|
|
{
|
|
public static function handle()
|
|
{
|
|
return self::home();
|
|
}
|
|
|
|
public static function home()
|
|
{
|
|
foreach (($_SESSION['flash'] ?? []) as $key => $value) {
|
|
echo '<div class="alert ' . $key . '">- ' . $value . '</div>';
|
|
}
|
|
|
|
if (App::auth()) {
|
|
echo 'You are already logged in!<br>';
|
|
echo '<form action="/gate/logout" method="post"><button>Logout</button></form>';
|
|
} else {
|
|
echo 'You are not logged in!<br>';
|
|
}
|
|
|
|
echo 'Your request is: ' . App::$req->uri(0);
|
|
}
|
|
}
|