aboutsummaryrefslogtreecommitdiff
path: root/views/login
diff options
context:
space:
mode:
authorSyndamia <kamen@syndamia.com>2025-01-26 14:04:11 +0200
committerSyndamia <kamen@syndamia.com>2025-01-26 14:04:11 +0200
commitbfa238c056f31f36c00faad1c5995cbb8af3bd26 (patch)
treee35d6b33fff3e79ae905d7dad699134553a1292d /views/login
parentc36f74386bcbb19c13915fe3796cb757aa7d1845 (diff)
downloadnowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar
nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.tar.gz
nowayforward_human-bfa238c056f31f36c00faad1c5995cbb8af3bd26.zip
feat!: Rework all views to be used with the router
Diffstat (limited to 'views/login')
-rw-r--r--views/login/index.php19
-rw-r--r--views/login/meta.php4
2 files changed, 9 insertions, 14 deletions
diff --git a/views/login/index.php b/views/login/index.php
index e538319..1013874 100644
--- a/views/login/index.php
+++ b/views/login/index.php
@@ -1,16 +1,7 @@
-<?php
- $title = 'Login to your account';
- include '../meta.php';
-
- $status = null;
- $token = null;
- runController('login');
-?>
-
-<?php if ($status !== null): ?>
- <?php if ($status !== ""): ?>
+<?php if (isset($user_status)): ?>
+ <?php if ($user_status !== ""): ?>
<p>
- Fail: <?= $status ?>
+ Fail: <?= $user_status ?>
</p>
<?php else: ?>
<p>
@@ -18,12 +9,12 @@
</p>
<script type="text/javascript">
sessionStorage.setItem("token", "<?= $token ?>");
- window.location.href = "/home/index.php";
+ window.location.href = "/";
</script>
<?php endif; ?>
<?php endif; ?>
-<form action="./index.php" method="POST">
+<form action="#" method="POST">
<input type="text" name="username" placeholder="Username" minlength="1" pattern="[A-Za-z][A-Za-z_0-9]*">
<input type="password" name="password" placeholder="Password" minlength="4">
<input type="submit" value="Login">
diff --git a/views/login/meta.php b/views/login/meta.php
new file mode 100644
index 0000000..06be3e8
--- /dev/null
+++ b/views/login/meta.php
@@ -0,0 +1,4 @@
+<?php
+
+$title = 'Login to your account';
+$controller = 'login';