diff --git a/config.php b/config.php index ca7f129..7203949 100644 --- a/config.php +++ b/config.php @@ -68,8 +68,16 @@ if (!isset($notemplate)) { $res = $sql->query("SELECT `value` FROM `config` WHERE `key` = \"sitename\";")->fetch_assoc(); $site_name = htmlspecialchars($res['value']); + // the flash + $message = null; + if (isset($_SESSION['flash'])) { + $message = $_SESSION['flash']; + unset($_SESSION['flash']); + } + $tpl->assign("logged_in", $_SESSION['logged_in']); $tpl->assign("site_name", $site_name); $tpl->assign("words_total", $words_total_count); $tpl->assign("inbox_count", $new_words_count); + $tpl->assign("message", $message); } \ No newline at end of file diff --git a/ucp.php b/ucp.php index e69de29..528efa4 100644 --- a/ucp.php +++ b/ucp.php @@ -0,0 +1,43 @@ + + * + * Oh, and before I forget... + * ________ __________ __ ____ __ ______ + * / ____/ / / / ____/ //_/ / __ \/ / / / __ \ + * / /_ / / / / / / ,< / /_/ / /_/ / /_/ / with + * / __/ / /_/ / /___/ /| | / ____/ __ / ____/ a + * /_/ \____/\____/_/ |_| /_/ /_/ /_/_/ cactus! + * + * Thanks for listening. + */ + +include_once 'config.php'; + +switch ($_GET['page']) { + case "login": { + $tpl->draw("login"); + break; + } + case "logout": { + session_destroy(); + session_start(); + $_SESSION['flash'] = "Sucessfully logged out"; + header('Location: index.php'); + break; + } + case "settings": { + $tpl->draw("settings"); + break; + } + case "inbox": + default: { + $tpl->draw("inbox"); + } +} \ No newline at end of file diff --git a/views/inbox.html b/views/inbox.html index 7aa1a0f..3da583c 100644 --- a/views/inbox.html +++ b/views/inbox.html @@ -1,6 +1,9 @@ {include="layout"} {include="navbar"}
+{if="$message"} +
{$message}
+{/if}