|
|
@ -7,13 +7,16 @@ class FrontController
|
|
|
|
global $error, $view, $rep;
|
|
|
|
global $error, $view, $rep;
|
|
|
|
session_start();
|
|
|
|
session_start();
|
|
|
|
// Check role permissions
|
|
|
|
// Check role permissions
|
|
|
|
|
|
|
|
echo "FrontController1\n";
|
|
|
|
if (isset($_SESSION['role'])) {
|
|
|
|
if (isset($_SESSION['role'])) {
|
|
|
|
$role = $_SESSION['role'];
|
|
|
|
$role = $_SESSION['role'];
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
$role = "visitor";
|
|
|
|
$role = "visitor";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// Check if action exists
|
|
|
|
// Check if action exists
|
|
|
|
|
|
|
|
echo "FrontController2\n";
|
|
|
|
$action = $_REQUEST['action'];
|
|
|
|
$action = $_REQUEST['action'];
|
|
|
|
|
|
|
|
echo $action . "\n";
|
|
|
|
if ($role == "user") {
|
|
|
|
if ($role == "user") {
|
|
|
|
if ($action == NULL) {
|
|
|
|
if ($action == NULL) {
|
|
|
|
new UserController();
|
|
|
|
new UserController();
|
|
|
@ -25,6 +28,7 @@ class FrontController
|
|
|
|
new UserController();
|
|
|
|
new UserController();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
|
|
|
|
echo "FrontController3\n";
|
|
|
|
new VisitorController();
|
|
|
|
new VisitorController();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (Exception $e) {
|
|
|
|
} catch (Exception $e) {
|
|
|
|