diff --git a/public_html/modules/login.php b/public_html/modules/login.php new file mode 100644 index 0000000..8fd3113 --- /dev/null +++ b/public_html/modules/login.php @@ -0,0 +1,49 @@ + $_POST['username']), 30, true); + } + catch (NotFoundException $e) + { + flash_error("Invalid username."); + redirect("/"); + } + + if($sUser->VerifyPassword($_POST['password'])) + { + $sUser->Authenticate(); + } + else + { + flash_error("Invalid password."); + redirect("/"); + } +} + +redirect("/"); diff --git a/public_html/rewrite.php b/public_html/rewrite.php index 3ddc2b8..9164fd9 100644 --- a/public_html/rewrite.php +++ b/public_html/rewrite.php @@ -25,6 +25,10 @@ $router->ignore_query = true; $router->routes = array( 0 => array( "^/$" => "modules/homepage.php", + "^/login$" => array( + "target" => "modules/login.php", + "methods" => "post" + ), "^/(.*)$" => "modules/page.php" ) );