fixed isAdmin
This commit is contained in:
parent
df103f9b86
commit
1e9705aa13
@ -49,7 +49,7 @@ class NotesController
|
|||||||
|
|
||||||
if ($note) {
|
if ($note) {
|
||||||
// Redirect to show notes page after successful creation
|
// Redirect to show notes page after successful creation
|
||||||
header('Location: ?controller=NotesController&page=showNotes');
|
header('Location: ?controller=Notes&page=showNotes');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
// If creation failed, show error message and stay on the form
|
// If creation failed, show error message and stay on the form
|
||||||
@ -69,7 +69,7 @@ class NotesController
|
|||||||
|
|
||||||
if ($note) {
|
if ($note) {
|
||||||
// Redirect to show notes page after successful creation
|
// Redirect to show notes page after successful creation
|
||||||
header('Location: ?controller=NotesController&page=showNotes');
|
header('Location: ?controller=Notes&page=showNotes');
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
// If creation failed, show error message and stay on the form
|
// If creation failed, show error message and stay on the form
|
||||||
@ -84,6 +84,6 @@ class NotesController
|
|||||||
{
|
{
|
||||||
$noteId = $_GET['id'];
|
$noteId = $_GET['id'];
|
||||||
$this->notesModel->deleteNote($noteId, $_SESSION['user_id']);
|
$this->notesModel->deleteNote($noteId, $_SESSION['user_id']);
|
||||||
header("Location: ?controller=NotesController&page=showNotes");
|
header("Location: ?controller=Notes&page=showNotes");
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -23,7 +23,7 @@ function isLoggedIn() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isAdmin() {
|
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') {
|
function sanitize($data, $flags = ENT_QUOTES, $encoding = 'UTF-8') {
|
||||||
|
@ -23,7 +23,7 @@ function isLoggedIn() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function isAdmin() {
|
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') {
|
function sanitize($data, $flags = ENT_QUOTES, $encoding = 'UTF-8') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user