-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.php
More file actions
53 lines (49 loc) · 1.81 KB
/
Copy pathdashboard.php
File metadata and controls
53 lines (49 loc) · 1.81 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
// ============ HelpDesk Portal · dashboard ============
require __DIR__ . '/includes/functions.php';
$me = require_login();
$pdo = db();
$st = $pdo->prepare('SELECT * FROM tickets WHERE user_id = ? ORDER BY id DESC');
$st->execute([(int)$me['id']]);
$tickets = $st->fetchAll();
page_header('Dashboard');
flash();
?>
<div class="card">
<h2>Dashboard</h2>
<p>Selamat datang, <b><?= e($me['username']) ?></b> (role: <?= e($me['role']) ?>).</p>
<p>
<a class="btn" href="/profile.php">Lihat / Edit Profil</a>
<a class="btn" href="/create-ticket.php">Buat Ticket</a>
<a class="btn" href="/tickets.php">Semua Ticket Saya</a>
</p>
</div>
<div class="card">
<h2>Security Research Lab</h2>
<p class="muted"><b>Target:</b> HelpDesk Portal<br>
<b>Objective:</b> identify unsafe handling of user-controlled HTML.</p>
<p class="muted"><b>Questions (pikirkan, jangan di-answer di sini):</b></p>
<ul class="muted">
<li>1. Which parameters accept user-controlled input?</li>
<li>2. Is the input reflected or stored?</li>
<li>3. Where does the data go?</li>
<li>4. Where is the data rendered?</li>
<li>5. Is output encoding applied?</li>
<li>6. Can another user see the injected content?</li>
<li>7. Is JavaScript execution possible?</li>
</ul>
</div>
<div class="card">
<h2>Ticket Terbaru Saya</h2>
<?php if (!$tickets): ?>
<p class="muted">Belum ada ticket.</p>
<?php else: foreach ($tickets as $t): ?>
<div class="list-item">
<h3>#<?= (int)$t['id'] ?> — <?= e($t['subject']) ?></h3>
<span class="badge <?= e($t['status']) ?>"><?= e($t['status']) ?></span>
<span class="muted small"> · <?= e($t['created_at']) ?></span><br>
<a href="/ticket.php?id=<?= (int)$t['id'] ?>">Lihat ticket</a>
</div>
<?php endforeach; endif; ?>
</div>
<?php page_footer(); ?>