-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
35 lines (23 loc) · 733 Bytes
/
Copy pathindex.php
File metadata and controls
35 lines (23 loc) · 733 Bytes
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
<?php
require_once __DIR__ . '/vendor/autoload.php';
session_start();
use Controllers\MainController;
use Login\FacebookConnection;
use Db\Database;
use Models\UserRepository;
$uri = $_SERVER['REQUEST_URI'];
$facebookConnection = new FacebookConnection();
$database = new Database();
$userRepository = new UserRepository($database);
$mainController = new MainController($facebookConnection, $userRepository);
if ('/index.php' == $uri) {
$mainController->loginAction();
} elseif ('/index.php/show' == $uri || isset($_GET['code'])) {
$mainController->showProfileAction();
if (isset($_GET['code'])) {
header('Location: ./show');
}
} else {
$mainController->renderErrorPage();
}
die();