-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
36 lines (27 loc) · 737 Bytes
/
index.php
File metadata and controls
36 lines (27 loc) · 737 Bytes
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
<?php
require_once 'core/init.php';
if (Session::exists('home'))
{
echo '<p>' . Session::flash('home') . '</p>';
}
$user = new User();
if ($user->isLoggedIn())
{
?>
<p>Hello, <a href="profile.php?user=<?php echo escape($user->data()->username); ?>">
<?php echo escape($user->data()->username); ?></a>!</p>
<ul>
<li><a href="logout.php">Logout</a></li>
<li><a href="update.php">Update info</a></li>
<li><a href="changepassword.php">Change password</a></li>
</ul>
<?php
if ($user->hasPermission('admin'))
{
echo '<p>You are an administrator.</p>';
}
}
else
{
echo '<p>You need to <a href="login.php">log in</a> or <a href="register.php">register</a></p>';
}