Add logout confirmation
This commit is contained in:
parent
568ad1bd78
commit
f3f98c25d4
6
app/view/confirm_logout.php
Normal file
6
app/view/confirm_logout.php
Normal file
@ -0,0 +1,6 @@
|
||||
<h1>Bekreft avlogging</h1>
|
||||
<p>Er du sikker på at du vil logge av?</p>
|
||||
|
||||
<form action="logout.php">
|
||||
<button type="submit">Logg ut</button>
|
||||
</form>
|
@ -20,7 +20,7 @@
|
||||
|
||||
<?php if ($this->user->loggedIn): ?>
|
||||
<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: ?>
|
||||
<span>Ikke pålogget</span>
|
||||
<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>
|
||||
|
||||
<?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: ?>
|
||||
<li><a href="<?=$this->config['root_url']?>login.php">Logg inn</a></li>
|
||||
<?php endif; ?>
|
||||
|
||||
<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>
|
||||
</div>
|
||||
|
||||
|
6
public/confirm_logout.php
Normal file
6
public/confirm_logout.php
Normal 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');
|
Reference in New Issue
Block a user