View sourcecode

The following files exists in this folder. Click to view.

account.php

39 lines ASCII Unix (LF)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php

session_start
();
if(!isset(
$_SESSION["username"])){
    
header("location:index.php?mess=session_timeout");
    exit();
}

$usernamehtmlspecialchars($_SESSION["username"]);

?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Account</title>
    <link rel="stylesheet" href="/spectre/spectre-master/dist/spectre.css">
</head>
<body style="text-align:center;">
    <h1>
    <?php 
    
echo"<h1>Welcome {$_SESSION["role"]} {$username}</h1>"
    
    if(
$_SESSION["role"] == "admin"){
    echo
"<br>
        <a class=\"btn\" href=\"h_adminpowers.php?mess=1\">create new users</a>
        <a class=\"btn\" href=\"h_adminpowers.php?mess=2\">delete user of choice</a>
        <a class=\"btn\" href=\"h_adminpowers.php?mess=3\">change username of any user</a>
        <a class=\"btn\" href=\"h_adminpowers.php?mess=4\">change password of any user</a>"
;
    }
    else{
        echo
"<br><p>You are a user, not an admin. this website sucks if you're not admin</p>";
    }
    echo
"<br><br><br><br><br><br><a class=\"btn btn-primary\" href=\"do.php?mess=logout\">Log out</a>"
    
?>
</body>
</html>