-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.controller.php
46 lines (40 loc) · 1.39 KB
/
app.controller.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
<?php //---------------------------------- END POINTS ----------------------------------\\
switch ($path_components[$path_index]) {
case 'formulario':
require_once("./app/registro/controller/registro.controller.php");
break;
case 'presentacion':
require_once("./app/presentacion/controller/presentacion.controller.php");
break;
case 'tareas':
if (checkSession()) {
require_once("./app/tareas/tareas.controller.php");
}else
header("Location: /login");
break;
case 'login':
if (!checkSession()) {
require_once("./app/Login/Login/controller/login.controller.php");
}else{
header("Location: /tareas");
}
break;
case 'registro':
if (!checkSession()) {
require_once("./app/Login/Registro/controller/registro.controller.php");
}else{
header("Location: /tareas");
}
break;
case 'logout':
session_destroy();
header("Location: /login");
break;
case "paises":
require_once("./app/paises/paises.controller.php");
break;
default:
header("HTTP/1.1 404 NOT FOUND");
break;
}
?>