-
Notifications
You must be signed in to change notification settings - Fork 2
/
oversight.php
165 lines (147 loc) · 6.02 KB
/
oversight.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
if (!defined('IN_SPYOGAME')) die("Hacking attempt");
include_once("mod/oversight/common.php");
$data = array();
///TITRE
$data["titre"] = "Oversight";
//menu
$data["menu"] = array();
$data["menu"][] = array("nom" => "Liste", "url" => "list");
$data["menu"][] = array("nom" => "Mise en surveillance", "url" => "add");
$data["menu"][] = array("nom" => "Insertions", "url" => "insert");
$data["menu"][] = array("nom" => "Information", "url" => "stat");
//Message avertissements
$data["msg"] = array();
$data["alert"] = array();
// le mod superapix n 'est plus requis
//if (!superapixinstalled()) {
// $data["alert"][] = "Attention, le mod superapix est requis";
//}
//liste des pages autorisées
$allowedPages = array("list", "insert","add","stat","analyse");
if(!isset($pub_page))
{
$pub_page = "list";
}
if (!in_array($pub_page, $allowedPages)) {
$pub_page = "list";
}
switch ($pub_page) {
case "insert":
$data["players"] = getPlayer();
$data['limit'] = 5000; // limite daffichage TODO modifiable
//-------Logique-----------
$data["menuactif"] = "insert";
$data["getListOgspyUsers"]=getListOgspyUsers();
//si null on doit tout montrer ....
$data["player_id"] = (isset($data["player_id"]) ) ? (int)$pub_player_id : null ;
$data["insert"] = (isset($pub_all) ) ? getALLInsert($data["player_id"],$data['limit']) : getMyInsert($data["player_id"],$data['limit']) ;
$data["ListSurveillance"] = getListSurveillance();
//-------------------------
//-------Appel Vue---------
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "insert.php");
include_once(FOLDER_VIEW . "footer.php");
//-------------------------
break;
case "list":
//datas communes
$data["players"] = getPlayer();
//-------Logique-----------
if (isset($pub_remove)&&isset($pub_player_id) && in_array($pub_player_id , getAllSurveillance()))
{
$playerName =(getPlayer())[(int)$pub_player_id]["name_player"];
delSurveillance($pub_player_id);
$data["msg"][] = "Suppression de la surveillance ".$playerName;
}
$data["menuactif"] = "list";
$data["ListSurveillance"] = getListSurveillance();
//-------------------------
//-------Appel Vue---------
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "list.php");
include_once(FOLDER_VIEW . "footer.php");
//-------------------------
break;
case "add":
//datas communes
$data["players"] = (isset($pub_findplayer)) ? getPlayer($db->sql_escape_string($pub_findplayer)) : array();
$data["lastfind"] = (isset($pub_findplayer)) ? $db->sql_escape_string($pub_findplayer) : "";
//-------Logique-----------
if (isset($pub_id) && !in_array($pub_id , getAllSurveillance())){
addSurveillance((int)$pub_id);
$playerName =(getPlayer())[(int)$pub_id]["name_player"];
$data["msg"][] = "Joueur ". $playerName . " ajouté";
}
$data["cssfile"] = FOLDER_CSS . "jscss.css";
$data["mySurveillance"] = getMySurveillance();
array_push($data["mySurveillance"], "0"); // player 0 ... :/ ne pas mettre en surveillance
$data["menuactif"] = "add";
$data["playerStatus"] = getStatus();
//-------------------------
//-------Appel Vue---------
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_JS . "jsadd.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "add.php");
include_once(FOLDER_VIEW . "footer.php");
//-------------------------
break;
case "stat":
//datas communes
$data["players"] = getPlayer();
//-------Logique-----------
$data["menuactif"] = "stat";
if (isset($pub_purge))
{
purgeInsertOrphan();
}
$data["CountALLInsert"] = getCountALLInsert();
$data["total_player"] = get_DisctinctPlayerId();
$data["total_sender"] = get_DisctinctSenderId();
$data["total_orphan"] = get_Orphan();
//-------------------------
//-------Appel Vue---------
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "stat.php");
include_once(FOLDER_VIEW . "footer.php");
//-------------------------
break;
case "analyse":
//datas communes
$data["players"] = getPlayer();
$data["daylist"] = weekdaylist();
//si filtre non défini
$data["nblastday"] = (isset($pub_nblastday)) ? (int)$pub_nblastday : 30 ; // par defaut 30 jour
$data["findday"] = (isset($pub_findday)) ? (int)$pub_findday : -1 ; // par defaut 30 jour
$data["messageDM"] = "";
if (isset($pub_coodepart) && isset($pub_cooarrivee) && isset($pub_player_id)) {
$data["messageDM"] = makeDM($pub_coodepart, $pub_cooarrivee, $pub_player_id);
}
//-------Logique-----------
$data["menuactif"] = "analyse";
$data["player_id"] = (int)$pub_player_id;
$data["cssfile"] = FOLDER_CSS . "jscss.css";
$limit = 9999999999999; // a retravailler :/
if (isset($pub_all))
{
$data["insert"] = getALLInsert($data["player_id"],$limit,$data["nblastday"], $data["findday"] );
}
else
{
$data["insert"] = getMyInsert($data["player_id"],$limit,$data["nblastday"], $data["findday"] );
}
//-------------------------
//-------Appel Vue---------
include_once(FOLDER_VIEW . "header.php");
include_once(FOLDER_VIEW . "menu.php");
include_once(FOLDER_VIEW . "analyse.php");
include_once(FOLDER_VIEW . "footer.php");
//-------------------------
break;
default:
break;
}