add authentication

This commit is contained in:
Hendrik
2017-01-26 13:29:56 +01:00
parent b89a575039
commit 1a53d01747
3 changed files with 24 additions and 0 deletions

View File

@@ -12,6 +12,14 @@
* This view adds the main layout over the screen.
* Header and menu.
*/
include_once ("../queries/user.php");
$userinfo = getRoleByID($_SESSION['userID'])->fetch(PDO::FETCH_ASSOC);
if ($userinfo['role'] != 'admin' AND $userinfo['role'] != 'owner') {
header("location:profile.php");
}
include("../views/main.php");
/* Add your view files here. */