diff options
Diffstat (limited to 'handler/admin/Login.php')
-rw-r--r-- | handler/admin/Login.php | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/handler/admin/Login.php b/handler/admin/Login.php deleted file mode 100644 index cade137..0000000 --- a/handler/admin/Login.php +++ /dev/null @@ -1,31 +0,0 @@ -<?php - -namespace handler\admin; - -use admin; -use csrf; -use RedirectResponse; -use Response; -use UnauthorizedException; - -class Login extends AdminRequestHandler { - - public function get(): Response { - if (admin::isAdmin()) - return new RedirectResponse('/admin/'); - return $this->skin->renderPage('admin/login'); - } - - public function post(): Response { - csrf::check('adminlogin'); - $password = $_POST['password'] ?? ''; - $valid = admin::checkPassword($password); - if ($valid) { - admin::logAuth(); - admin::setCookie(); - return new RedirectResponse('/admin/'); - } - throw new UnauthorizedException('nice try'); - } - -}
\ No newline at end of file |