This commit is contained in:
jakani24
2024-01-15 16:48:24 +01:00
parent 59961c3003
commit f54dc4fa67
2 changed files with 40 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ session_start();
$_SESSION["username"]=$username; $_SESSION["username"]=$username;
$_SESSION["login"]=true; $_SESSION["login"]=true;
$_SESSION["perms"]=$row["perms"]; $_SESSION["perms"]=$row["perms"];
$_SESSION["email"]=$row["email"];
echo '<script>window.location.href = "/system/secure_zone/php/index.php";</script>'; echo '<script>window.location.href = "/system/secure_zone/php/index.php";</script>';
exit(); exit();

View File

@@ -0,0 +1,39 @@
<?php
session_start();
// Check if the user is logged in
if (!isset($_SESSION['username']) or !isset($_SESSION["login"])) {
// Redirect to the login page or handle unauthorized access
header("Location: /login.php");
exit();
}
$username = $_SESSION['username'];
$perms = $_SESSION["perms"];
$email = $_SESSION["email"];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
<title>Profile</title>
</head>
<body>
<h4>Your Profile</h4>
<h5><?php echo($username); ?></h5>
<form action="profile.php" method="post">
<div class="form-group">
<label for="username">Username:</label>
<input type="text" class="form-control" id="username" name="username" value="<?php echo($username); ?>" required>
</div>
<div class="form-group">
<label for="email">Email:</label>
<input type="email" class="form-control" id="email" name="email" value="<?php echo($email); ?>" required>
</div>
<button type="submit" class="btn btn-primary btn-block">Update</button>
</form>
</body>
</html>