-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path404.php
25 lines (23 loc) · 1.05 KB
/
404.php
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
<?php
require_once('./scripts/php/Utente.php');
require_once('./scripts/php/Sessione.php');
Sessione::startSession();
$gestioneLogin = "";
if(!isset($_SESSION['user'])){
$gestioneLogin = "<a href=\"login.php\" class=\"header-button\" >Login</a><a href=\"registrazione.php\" class=\"header-button\" >Registrati</a>";
}else{
if($_SESSION['user'] -> getPermessi() == '11'){
$gestioneLogin .= "<a href=\"menu_admin.php\" class=\"header-button\">Area riservata</a>";
}
$gestioneLogin .= "<a href=\"logout.php\" class=\"header-button\">Logout</a>";
}
$daSostituire = array(
"{{pageTitle}}" => "404: Pagina non trovata - Studio AR",
"{{pageDescription}}" => "pagina di errore 404",
"{{gestioneLogin}}" => $gestioneLogin
);
http_response_code(404);
echo str_replace(array_keys($daSostituire), array_values($daSostituire), file_get_contents('./static/_inizio.html'));
echo file_get_contents('./static/404.html');
echo file_get_contents('./static/_fine.html');
?>