-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·75 lines (46 loc) · 1.69 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
//session_set_cookie_params ( 0 , '/' , 'localhost' , false , true );
session_name('usr');
session_start();
session_regenerate_id();
include_once ('global/config.php');
try {
if ( isset ( $_GET [ ACTION ] ) ) {
switch ( $_GET [ ACTION ] ) {
case 'welcome':
require_once ( $page [ 'controller' ] [ 'welcome' ] );
break;
case 'signUp':
require_once ( $page [ 'controller' ] [ 'signUp' ] );
break;
case 'accountConfirmation':
require_once ( $page [ 'controller' ] [ 'confirm' ] );
break;
case 'logIn':
require_once ( $page [ 'controller' ] [ 'logIn' ] );
break;
case 'logOut':
require_once ( $page [ 'controller' ] [ 'logOut' ] );
break;
case 'home':
require_once ( $page [ 'controller' ] [ 'home' ] );
break;
case 'profile':
require_once ( $page [ 'controller' ] [ 'profile' ] );
break;
case 'myProfile':
require_once ( $page [ 'controller' ] [ 'myProfile' ] );
break;
case 'error':
$errorMsg = isset ( $_GET [ 'errorMsg' ] ) ? $_GET['errorMsg'] : '';
throw new Exception ( $errorMsg );
default :
throw new Exception ( 'Page not found' );
break;
}
} else {
require_once ( $page [ 'controller' ] [ 'home' ] );
}
} catch (Exception $e) {
require_once ( $page [ 'controller' ] [ 'error' ] );
}