diff --git a/Controller/NotesController.php b/Controller/NotesController.php index 77c1190..9dfafc3 100644 --- a/Controller/NotesController.php +++ b/Controller/NotesController.php @@ -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"); } } \ No newline at end of file diff --git a/Views/Notes/createNote.phtml b/Views/Notes/createNote.phtml index 82acc2d..3181cc9 100644 --- a/Views/Notes/createNote.phtml +++ b/Views/Notes/createNote.phtml @@ -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') { diff --git a/Views/Notes/editNote.phtml b/Views/Notes/editNote.phtml index dcc388a..2797213 100644 --- a/Views/Notes/editNote.phtml +++ b/Views/Notes/editNote.phtml @@ -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') {