fixed isAdmin

This commit is contained in:
Felix Ivo 2025-06-23 14:19:04 +02:00
parent df103f9b86
commit 1e9705aa13
3 changed files with 5 additions and 5 deletions

View File

@ -49,7 +49,7 @@ class NotesController
if ($note) {
// Redirect to show notes page after successful creation
header('Location: ?controller=NotesController&page=showNotes');
header('Location: ?controller=Notes&page=showNotes');
exit();
} else {
// If creation failed, show error message and stay on the form
@ -69,7 +69,7 @@ class NotesController
if ($note) {
// Redirect to show notes page after successful creation
header('Location: ?controller=NotesController&page=showNotes');
header('Location: ?controller=Notes&page=showNotes');
exit();
} else {
// If creation failed, show error message and stay on the form
@ -84,6 +84,6 @@ class NotesController
{
$noteId = $_GET['id'];
$this->notesModel->deleteNote($noteId, $_SESSION['user_id']);
header("Location: ?controller=NotesController&page=showNotes");
header("Location: ?controller=Notes&page=showNotes");
}
}

View File

@ -23,7 +23,7 @@ function isLoggedIn() {
}
function isAdmin() {
return false;// isLoggedIn() && isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
return isLoggedIn() && isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
}
function sanitize($data, $flags = ENT_QUOTES, $encoding = 'UTF-8') {

View File

@ -23,7 +23,7 @@ function isLoggedIn() {
}
function isAdmin() {
return false;// isLoggedIn() && isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
return isLoggedIn() && isset($_SESSION['role']) && $_SESSION['role'] === 'admin';
}
function sanitize($data, $flags = ENT_QUOTES, $encoding = 'UTF-8') {