Part on authorisation finished
This commit is contained in:
parent
0c5e0088f7
commit
44a6d295d8
2 changed files with 26 additions and 15 deletions
|
|
@ -1,11 +1,21 @@
|
|||
<?php
|
||||
$username = 'appUser';
|
||||
$password = 'password';
|
||||
$config = require('config.php');
|
||||
$db = new Database($config['database'], $username, $password);
|
||||
$username = 'appUser';
|
||||
$password = 'password';
|
||||
$config = require('config.php');
|
||||
$db = new Database($config['database'], $username, $password);
|
||||
|
||||
$heading = "Note";
|
||||
$heading = "Note";
|
||||
|
||||
$note = $db->query('select * from notes where id = :id', ['id' => $_GET['id']] )->fetch();
|
||||
//dd($notes);
|
||||
require "views/note.view.php";
|
||||
$note = $db->query('select * from notes where id = :id', [
|
||||
'id' => $_GET['id']
|
||||
])->fetch();
|
||||
|
||||
if (!$note) {
|
||||
abort();
|
||||
}
|
||||
$currentUserId = 1;
|
||||
if ($note['user_id'] != $currentUserId) {
|
||||
abort(Response::FORBIDDEN);
|
||||
}
|
||||
//dd($notes);
|
||||
require "views/note.view.php";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue