forked from iaguas/construyetupc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminController.php
62 lines (54 loc) · 1.61 KB
/
adminController.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
<?php
/**
* Fichero: adminController.php
* Descripcion: dicho documento representa al controlador para la parte del Admin.
*/
require 'models/DBHelper.php';
function adminController($match){
@session_start();
$admin = false;
$db = new DBHelper();
if($db->mCheckAdminSession(session_id())) {
$admin = true;
}
if($match) {
if($admin) {
switch($match['target']) {
case 'vShowAdminLogin':
vShowAdmin();
break;
case 'vCrawlerPanel':
vShowCrawlerPanel();
break;
case 'vInsertCompPanel':
vShowInsertCompPanel();
break;
case 'vAdminLogin':
vShowAdmin();
break;
case 'vShowAdmin()':
vShowAdmin();
break;
case 'vShowEmailsLanding':
echo 'aaa';
vShowEmails(mGetEmails());
break;
case 'vUpdateAmazon' :
vShowUpdateAmazon();
// Por defecto se llama a la función indicada en la ruta
default:
call_user_func($match['target']);
break;
}
}
else {
vShowAdminLogin();
exit();
// Mostrar mensaje de sessión incorrecta/expirada??
}
}
else {
// Si no encaja, mostramos 404 y nos echamos una siesta
echo file_get_contents('views/404.html');
}
}