diff --git a/source/webui/pages/login.php b/source/webui/pages/login.php new file mode 100644 index 0000000..1452db1 --- /dev/null +++ b/source/webui/pages/login.php @@ -0,0 +1,30 @@ +request(); +$auth = $main->auth(); + +$authenticated = false; +$authentication_failed = false; + +if ($request->exists('do')) { + $username = StatusBoard_Main::issetelse($_POST['username'], Sihnon_Exception_InvalidParameters); + $password = StatusBoard_Main::issetelse($_POST['username'], Sihnon_Exception_InvalidParameters); + + try { + $auth->authenticate($username, $password); + $authenticated = true; + + StatusBoard_Page::redirect('home'); + + } catch (Sihnon_Exception_UnknownUser $e) { + $authentication_failed = true; + } catch (Sihnon_Exception_IncorrectPassword $e) { + $authentication_failed = true; + } +} + +$this->smarty->assign('authentication', $authenticated); +$this->smarty->assign('authentication_failed', $authentication_failed); + +?> \ No newline at end of file diff --git a/source/webui/templates/login.tpl b/source/webui/templates/login.tpl new file mode 100644 index 0000000..8cf530a --- /dev/null +++ b/source/webui/templates/login.tpl @@ -0,0 +1,17 @@ +{if $authentication_failed} + +