-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
49 lines (40 loc) · 1.41 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
* Created by Daniel Toll, edited by Oskar Klintrot
*/
/**
* The index for the site
*/
//INCLUDE THE FILES NEEDED...
require_once('view/LoginView.php');
require_once('view/DateTimeView.php');
require_once('view/LayoutView.php');
require_once('model/LoginModel.php');
require_once('controller/LoginController.php');
//MAKE SURE ERRORS ARE SHOWN... MIGHT WANT TO TURN THIS OFF ON A PUBLIC SERVER
error_reporting(E_ALL);
ini_set('display_errors', 'On');
session_start();
//CREATE OBJECTS OF THE VIEWS
$LoginModel = new \model\LoginModel();
$LoginController = new \controller\LoginController($LoginModel);
$LoginView = $LoginController->getLoginView();
$DateTimeView = new \view\DateTimeView();
$LayoutView = new \view\LayoutView();
$LoginController->doLogin();
$LayoutView->render($LoginModel->userLoggedIn(), $LoginView, $DateTimeView);
// echo "Server request method";
// echo var_dump($_SERVER['REQUEST_METHOD']);
//var_dump($_SESSION["LoggedInSession"]);
//if(isset($_COOKIE["LoginView::CookieName"]) || isset($_COOKIE["LoginView::CookiePassword"])) {
// if (isset($_COOKIE["LoginView::CookieName"]))
// var_dump($_COOKIE["LoginView::CookieName"]);
// else
// echo 'No username cookie found';
// if (isset($_COOKIE["LoginView::CookiePassword"]))
// var_dump($_COOKIE["LoginView::CookiePassword"]);
// else
// echo 'No password cookie found';
//}
//else
// echo 'No cookies found';