Add logout confirmation

This commit is contained in:
William 2022-01-24 11:46:44 +01:00
parent 568ad1bd78
commit f3f98c25d4
3 changed files with 15 additions and 2 deletions

View File

@ -0,0 +1,6 @@
<h1>Bekreft avlogging</h1>
<p>Er du sikker at du vil logge av?</p>
<form action="logout.php">
<button type="submit">Logg ut</button>
</form>

View File

@ -20,7 +20,7 @@
<?php if ($this->user->loggedIn): ?> <?php if ($this->user->loggedIn): ?>
<span><?=htmlspecialchars($this->user->username)?></span> <span><?=htmlspecialchars($this->user->username)?></span>
<a href="<?=$this->config['root_url']?>logout.php">Logg ut</a> <a href="<?=$this->config['root_url']?>confirm_logout.php">Logg ut</a>
<?php else: ?> <?php else: ?>
<span>Ikke pålogget</span> <span>Ikke pålogget</span>
<a href="<?=$this->config['root_url']?>login.php">Logg inn</a> <a href="<?=$this->config['root_url']?>login.php">Logg inn</a>
@ -38,12 +38,13 @@
<li><a href="<?=$this->config['root_url']?>index.php">Forside</a></li> <li><a href="<?=$this->config['root_url']?>index.php">Forside</a></li>
<?php if ($this->user->loggedIn): ?> <?php if ($this->user->loggedIn): ?>
<li><a href="<?=$this->config['root_url']?>logout.php">Logg ut</a></li> <li><a href="<?=$this->config['root_url']?>confirm_logout.php">Logg ut</a></li>
<?php else: ?> <?php else: ?>
<li><a href="<?=$this->config['root_url']?>login.php">Logg inn</a></li> <li><a href="<?=$this->config['root_url']?>login.php">Logg inn</a></li>
<?php endif; ?> <?php endif; ?>
<li><a href="<?=$this->config['root_url']?>example.php">Eksempel</a></li> <li><a href="<?=$this->config['root_url']?>example.php">Eksempel</a></li>
<li><a href="<?=$this->config['root_url']?>simulator.php">Simulator</a></li>
</ul> </ul>
</div> </div>

View File

@ -0,0 +1,6 @@
<?php
$app = require '../app/inc.php';
$app->view('template/header', ["title" => "Bekreft avlogging"]);
$app->view('confirm_logout');
$app->view('template/footer');