aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/header.php1
-rw-r--r--views/profile/index.php16
-rw-r--r--views/register/index.php25
3 files changed, 42 insertions, 0 deletions
diff --git a/views/header.php b/views/header.php
index 40afb0b..ace2eb7 100644
--- a/views/header.php
+++ b/views/header.php
@@ -16,6 +16,7 @@
<a href="/test/index.php">Test</a>
<a href="/sample_archive/index.php">Sample Archive</a>
<div class="flex-expand"></div>
+ <a href="/register/index.php">Register</a>
<div class="fadeout-right"></div>
</nav>
</header>
diff --git a/views/profile/index.php b/views/profile/index.php
new file mode 100644
index 0000000..3e79d71
--- /dev/null
+++ b/views/profile/index.php
@@ -0,0 +1,16 @@
+<?php
+ $title = $_GET["user"] . ' - Profile';
+ include '../meta.php';
+
+ $user = null;
+ runController('user');
+?>
+
+<?php if ($user !== null): ?>
+ <section>
+ <?php echo $user->Username ?>
+ <?php echo $user->Role ?>
+ </section>
+<?php else: ?>
+ <h2>User "<?php echo $_GET["user"] ?>" doesn't exist!</h2>
+<?php endif; ?>
diff --git a/views/register/index.php b/views/register/index.php
new file mode 100644
index 0000000..4e2abb1
--- /dev/null
+++ b/views/register/index.php
@@ -0,0 +1,25 @@
+<?php
+ $title = 'Register a new user';
+ include '../meta.php';
+
+ $status = null;
+ runController('register');
+?>
+
+<?php if ($status !== null): ?>
+ <?php if ($status !== ""): ?>
+ <p>
+ Fail: <?php echo $status ?>
+ </p>
+ <?php else: ?>
+ <p>
+ Success!
+ </p>
+ <?php endif; ?>
+<?php endif; ?>
+
+<form action="./index.php" 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="Register">
+</form>