diff --git a/frontend/css/cvm.css b/frontend/css/cvm.css index 3362d8c..0c03dbd 100644 --- a/frontend/css/cvm.css +++ b/frontend/css/cvm.css @@ -424,3 +424,21 @@ table.vpslist tr:hover margin: 0px; padding-left: 24px; } + + +input +{ + padding: 4px 6px; +} + +input, label +{ + margin-top: 0px !important; + margin-bottom: 0px !important; +} + +button.column +{ + margin-left: 1.6% !important; + margin-right: 1.6% !important; +} diff --git a/frontend/module.login.php b/frontend/module.login.php new file mode 100644 index 0000000..8538190 --- /dev/null +++ b/frontend/module.login.php @@ -0,0 +1,56 @@ +VerifyPassword($_POST['password'])) + { + $_SESSION['userid'] = $sLoginUser->sId; + header("Location: /"); + die(); + } + else + { + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Login failed", "The login details you provided are invalid. Please try again."); + $sError .= $err->Render(); + } + } + else + { + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "Login failed", "The login details you provided are invalid. Please try again."); + $sError .= $err->Render(); + } +} + +$sMainContents = Templater::InlineRender("login", $locale->strings, array( + 'error' => $sError, + 'field-username' => $sFieldUsername +)); diff --git a/frontend/module.logout.php b/frontend/module.logout.php new file mode 100644 index 0000000..37c20da --- /dev/null +++ b/frontend/module.logout.php @@ -0,0 +1,29 @@ +Render(); +} +else +{ + $err = new CPHPErrorHandler(CPHP_ERRORHANDLER_TYPE_ERROR, "You are not logged in", "You can only logout when you are already logged in."); + $sMainContents .= $err->Render(); +} diff --git a/frontend/rewrite.php b/frontend/rewrite.php index fc2546a..fa7f597 100644 --- a/frontend/rewrite.php +++ b/frontend/rewrite.php @@ -16,7 +16,7 @@ require("includes/include.base.php"); $sTemplateParameters = array(); -$_SESSION['userid'] = 1; +//$_SESSION['userid'] = 1; if(!empty($_SESSION['userid'])) { diff --git a/frontend/templates/login.tpl b/frontend/templates/login.tpl new file mode 100644 index 0000000..3c489ac --- /dev/null +++ b/frontend/templates/login.tpl @@ -0,0 +1,18 @@ +