summaryrefslogtreecommitdiff
path: root/public/account/index.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-04-20 10:46:32 +0500
committerilotterytea <iltsu@alright.party>2025-04-20 10:46:32 +0500
commit3b6c6e5774dec41a16da03d1bb8497b448cfa564 (patch)
tree4e9c79624c43c92dbcc288a61f5b92b1772d3c5c /public/account/index.php
parent43e46d21c263fe8a8672e8e4b3ce38803b9cd089 (diff)
feat: users, account management, authentication system
Diffstat (limited to 'public/account/index.php')
-rw-r--r--public/account/index.php59
1 files changed, 59 insertions, 0 deletions
diff --git a/public/account/index.php b/public/account/index.php
new file mode 100644
index 0000000..8f40ec9
--- /dev/null
+++ b/public/account/index.php
@@ -0,0 +1,59 @@
+<?php
+include "../../src/accounts.php";
+authorize_user();
+
+if (!isset($_SESSION["user_id"], $_SESSION["user_name"])) {
+ header("Location: /account/login");
+ exit;
+}
+
+include "../../src/partials.php";
+
+?>
+
+<html>
+
+<head>
+ <title>Account management - alright.party</title>
+ <link rel="stylesheet" href="/static/style.css">
+</head>
+
+<body>
+ <div class="container">
+ <div class="wrapper">
+ <?php html_navigation_bar() ?>
+
+ <section class="content">
+ <section class="box accman">
+ <h1>Account management</h1>
+
+ <form action="/account.php" method="POST" enctype="multipart/form-data">
+ <h2>Profile</h2>
+ <h3>Profile picture</h3>
+ <img src="/static/userdata/avatars/<?php echo $_SESSION["user_id"] ?>" id="pfp" width="64"
+ height="64">
+ <input type="file" name="pfp" id="pfp">
+
+ <h3>Username</h3>
+ <input type="text" name="username" value="<?php echo $_SESSION["user_name"] ?>">
+
+ <button type="submit">Save</button>
+ </form>
+
+ <hr>
+
+ <form action="/account/signout.php">
+ <h2>Security</h2>
+ <button type="submit">Sign out everywhere</button>
+ </form>
+
+ <form action="/account/delete.php">
+ <button class="red" type="submit">Delete me</button>
+ </form>
+ </section>
+ </section>
+ </div>
+ </div>
+</body>
+
+</html> \ No newline at end of file