21 lines
		
	
	
		
			443 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			21 lines
		
	
	
		
			443 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| $app = require '../app/inc.php';
 | |
| 
 | |
| if (!$app->user->loggedIn)
 | |
| {
 | |
|     $app->redirect('login.php');
 | |
| }
 | |
| 
 | |
| $confirm = filter_input(INPUT_GET, 'confirm', FILTER_VALIDATE_BOOLEAN);
 | |
| 
 | |
| if (!$confirm)
 | |
| {
 | |
|     $app->view('template/header', ["title" => "Bekreft avlogging"]);
 | |
|     $app->view('pages/logout');
 | |
|     $app->view('template/footer');
 | |
|     die();
 | |
| }
 | |
| 
 | |
| $app->user->logout();
 | |
| $app->session->flash('Du har blitt logget av');
 | |
| $app->redirect("login.php"); |