Subversion Repositories ALCASAR

Rev

Rev 3043 | Rev 3099 | Go to most recent revision | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3043 Rev 3070
1
<?php
1
<?php
2
/* written by steweb57 & Rexy */
2
/* written by steweb57 & Rexy */
3
 
3
 
4
# Choice of language
4
# Choice of language
5
$Language = 'en';
5
$Language = 'en';
6
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
6
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
7
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
7
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
8
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
8
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
9
if($Language == 'fr') {
9
if($Language == 'fr') {
10
	$l_services_title	= "Configuration des services";
10
	$l_services_title	= "Configuration des services";
11
	$l_main_services	= "Services principaux";
11
	$l_main_services	= "Services principaux";
12
	$l_filter_services	= "Services de filtrage";
12
	$l_filter_services	= "Services de filtrage";
13
	$l_opt_services		= "Services optionnels";
13
	$l_opt_services		= "Services optionnels";
14
	$l_service_title 	= "Rôle du service";
14
	$l_service_title 	= "Rôle du service";
15
	$l_service_start 	= "Démarrer";
15
	$l_service_start 	= "Démarrer";
16
	$l_service_stop 	= "Arréter";
16
	$l_service_stop 	= "Arréter";
17
	$l_service_restart 	= "Redémarrer";
17
	$l_service_restart 	= "Redémarrer";
18
	$l_service_status 	= "Status";
18
	$l_service_status 	= "Status";
19
	$l_service_status_img_ok= "Démarré";
19
	$l_service_status_img_ok= "Démarré";
20
	$l_service_status_img_ko= "Arrété";
20
	$l_service_status_img_ko= "Arrété";
21
	$l_service_action 	= "Actions";
21
	$l_service_action 	= "Actions";
22
	$l_radiusd		= "Serveur d'authentification et d'autorisation";
22
	$l_radiusd		= "Serveur d'authentification et d'autorisation";
23
	$l_chilli		= "Passerelle d'interception et serveur DHCP";
23
	$l_chilli		= "Passerelle d'interception et serveur DHCP";
24
	$l_e2guardian		= "Filtre d'URL et de contenu WEB";
24
	$l_e2guardian		= "Filtre d'URL et de contenu WEB";
25
	$l_mysqld		= "Serveur de la base des usagers";
25
	$l_mysqld		= "Serveur de la base des usagers";
26
	$l_lighttpd		= "Serveur WEB (Alcasar Control Center)";
26
	$l_lighttpd		= "Serveur WEB (Alcasar Control Center)";
27
	$l_sshd			= "Accès sécurisée distant";
27
	$l_sshd			= "Accès sécurisée distant";
28
	$l_clamav_freshclam	= "Mise à jour de l'antivirus (toutes les 4 heures)";
28
	$l_clamav_freshclam	= "Mise à jour de l'antivirus (toutes les 4 heures)";
29
	$l_clamav_daemon	= "Antimalware";
29
	$l_clamav_daemon	= "Antimalware";
30
	$l_ntpd			= "Service de mise à l'heure réseau";
30
	$l_ntpd			= "Service de mise à l'heure réseau";
31
	$l_postfix		= "Service de messagerie";
31
	$l_postfix		= "Service de messagerie";
32
	$l_fail2ban		= "Détecteur d'intrusion";
32
	$l_fail2ban		= "Détecteur d'intrusion";
33
	$l_nfcapd 		= "Collecteur de flux NetFlow";
33
	$l_nfcapd 		= "Collecteur de flux NetFlow";
34
	$l_vnstat		= "Grapheur de flux réseau";
34
	$l_vnstat		= "Grapheur de flux réseau";
35
	$l_unbound		= "Serveur DNS principal";
35
	$l_unbound		= "Serveur DNS principal";
36
	$l_unbound_blacklist	= "Serveur DNS pour la Blacklist";
36
	$l_unbound_blacklist	= "Serveur DNS pour la Blacklist";
37
	$l_unbound_whitelist	= "Serveur DNS pour la Whitelist";
37
	$l_unbound_whitelist	= "Serveur DNS pour la Whitelist";
38
	$l_dnsmasq_whitelist	= "Serveur DNS pour la Whitelist (IPSET)";
38
	$l_dnsmasq_whitelist	= "Serveur DNS pour la Whitelist (IPSET)";
39
	$l_unbound_blackhole	= "Serveur DNS 'trou noir'";
39
	$l_unbound_blackhole	= "Serveur DNS 'trou noir'";
40
	$l_ulogd_ssh		= "journalisation des accès par SSH";
40
	$l_ulogd_ssh		= "journalisation des accès par SSH";
41
	$l_ulogd_ext_access	= "journalisation des tentatives d'accès externes";
41
	$l_ulogd_ext_access	= "journalisation des tentatives d'accès externes";
42
	$l_ulogd_traceability	= "journalisation des connexions WEB filtrés";
42
	$l_ulogd_traceability	= "journalisation des connexions WEB filtrés";
43
	$l_wifi4eu_id	= "Entrez votre identifiant réseau";
43
	$l_wifi4eu_id	= "Entrez votre identifiant réseau";
44
	$l_execute		= "Exécuter";
44
	$l_execute		= "Exécuter";
45
	$l_stop_restart		= "Arrêt et redémarrage du système";
45
	$l_stop_restart		= "Arrêt et redémarrage du système";
46
	$l_halt			= "Arréter le système";
46
	$l_halt			= "Arréter le système";
47
	$l_reboot		= "Relancer le système";
47
	$l_reboot		= "Relancer le système";
48
} else if($Language == 'es') {
48
} else if($Language == 'es') {
49
	$l_services_title	= "Configuración de Servicios";
49
	$l_services_title	= "Configuración de Servicios";
50
	$l_main_services	= "Servicios Principales";
50
	$l_main_services	= "Servicios Principales";
51
	$l_filter_services	= "Servicios de Filtrado";
51
	$l_filter_services	= "Servicios de Filtrado";
52
	$l_opt_services		= "Servicios Opcionales";
52
	$l_opt_services		= "Servicios Opcionales";
53
	$l_service_title 	= "función del servicio";
53
	$l_service_title 	= "función del servicio";
54
	$l_service_start 	= "Iniciar";
54
	$l_service_start 	= "Iniciar";
55
	$l_service_stop 	= "Detener";
55
	$l_service_stop 	= "Detener";
56
	$l_service_restart 	= "Reiniciar";
56
	$l_service_restart 	= "Reiniciar";
57
	$l_service_status 	= "Estado";
57
	$l_service_status 	= "Estado";
58
	$l_service_status_img_ok= "Corriendo";
58
	$l_service_status_img_ok= "Corriendo";
59
	$l_service_status_img_ko= "Detenido";
59
	$l_service_status_img_ko= "Detenido";
60
	$l_service_action 	= "Acciones";
60
	$l_service_action 	= "Acciones";
61
	$l_radiusd		= "Servidor de autenticación y autorización.";
61
	$l_radiusd		= "Servidor de autenticación y autorización.";
62
	$l_chilli		= "Pasarela de interceptación y servidor DHCP";
62
	$l_chilli		= "Pasarela de interceptación y servidor DHCP";
63
	$l_e2guardian		= "Filtro de contenidos URL y WEB";
63
	$l_e2guardian		= "Filtro de contenidos URL y WEB";
64
	$l_mysqld		= "Motor de base de datos para usuarios";
64
	$l_mysqld		= "Motor de base de datos para usuarios";
65
	$l_lighttpd		= "Servidor WEB (ALCASAR Control Center)";
65
	$l_lighttpd		= "Servidor WEB (ALCASAR Control Center)";
66
	$l_sshd			= "Servidor Seguro Acceso Remoto";
66
	$l_sshd			= "Servidor Seguro Acceso Remoto";
67
	$l_clamav_freshclam		= "Proceso de actualización Antivirus (cada 4 horas)";
67
	$l_clamav_freshclam		= "Proceso de actualización Antivirus (cada 4 horas)";
68
	$l_clamav_daemon	= "Antimalware";
68
	$l_clamav_daemon	= "Antimalware";
69
	$l_ntpd			= "Servidor de hora";
69
	$l_ntpd			= "Servidor de hora";
-
 
70
	$l_postfix		= "Servicio de correo electrónico";
70
	$l_fail2ban		= "Sistema de Detección de Intrusos";
71
	$l_fail2ban		= "Sistema de Detección de Intrusos";
71
	$l_nfcapd		= "Colector de flujo NetFlow";
72
	$l_nfcapd		= "Colector de flujo NetFlow";
72
	$l_vnstat		= "Graficador de tráfico de red";
73
	$l_vnstat		= "Graficador de tráfico de red";
73
	$l_unbound		= "Servidor DNS principal ";
74
	$l_unbound		= "Servidor DNS principal ";
74
	$l_unbound_blacklist	= "Servidor DNS de Lista Negra";
75
	$l_unbound_blacklist	= "Servidor DNS de Lista Negra";
75
	$l_unbound_whitelist	= "Servidor DNS de Lista Blanca";
76
	$l_unbound_whitelist	= "Servidor DNS de Lista Blanca";
76
	$l_dnsmasq_whitelist	= "Servidor DNS de Lista Blanca (IPSET)";
77
	$l_dnsmasq_whitelist	= "Servidor DNS de Lista Blanca (IPSET)";
77
	$l_unbound_blackhole	= "Agujero negro DNS";
78
	$l_unbound_blackhole	= "Agujero negro DNS";
78
	$l_ulogd_ssh		= "Proceso de registro para accesos SSH";
79
	$l_ulogd_ssh		= "Proceso de registro para accesos SSH";
79
	$l_ulogd_ext_access	= "Proceso de registro de intentos de accesos externos";
80
	$l_ulogd_ext_access	= "Proceso de registro de intentos de accesos externos";
80
	$l_ulogd_traceability	= "Proceso de registro de acceso WEB";
81
	$l_ulogd_traceability	= "Proceso de registro de acceso WEB";
81
	$l_wifi4eu_id	= "Introduzca su identificador de red";
82
	$l_wifi4eu_id	= "Introduzca su identificador de red";
82
	$l_execute		= "Ejecutar";
83
	$l_execute		= "Ejecutar";
83
	$l_stop_restart		= "Apagado y Reinicio del sistema";
84
	$l_stop_restart		= "Apagado y Reinicio del sistema";
84
	$l_halt			= "Apagar el sistema";
85
	$l_halt			= "Apagar el sistema";
85
	$l_reboot		= "Reiniciar el sistema";
86
	$l_reboot		= "Reiniciar el sistema";
86
} else {
87
} else {
87
	$l_services_title	= "Services configuration";
88
	$l_services_title	= "Services configuration";
88
	$l_main_services	= "Main services";
89
	$l_main_services	= "Main services";
89
	$l_filter_services	= "Filtering services";
90
	$l_filter_services	= "Filtering services";
90
	$l_opt_services		= "Optional services";
91
	$l_opt_services		= "Optional services";
91
	$l_service_title 	= "Role of the service";
92
	$l_service_title 	= "Role of the service";
92
	$l_service_start 	= "Start";
93
	$l_service_start 	= "Start";
93
	$l_service_stop 	= "Stop";
94
	$l_service_stop 	= "Stop";
94
	$l_service_restart 	= "Restart";
95
	$l_service_restart 	= "Restart";
95
	$l_service_status 	= "Status";
96
	$l_service_status 	= "Status";
96
	$l_service_status_img_ok= "Running";
97
	$l_service_status_img_ok= "Running";
97
	$l_service_status_img_ko= "Stopped";
98
	$l_service_status_img_ko= "Stopped";
98
	$l_service_action 	= "Actions";
99
	$l_service_action 	= "Actions";
99
	$l_radiusd		= "Authentication and authorisation server";
100
	$l_radiusd		= "Authentication and authorisation server";
100
	$l_chilli		= "Interception gateway and DHCP server";
101
	$l_chilli		= "Interception gateway and DHCP server";
101
	$l_e2guardian		= "URL and WEB content filter";
102
	$l_e2guardian		= "URL and WEB content filter";
102
	$l_mysqld		= "User database server";
103
	$l_mysqld		= "User database server";
103
	$l_lighttpd		= "WEB server (ALCASAR Control Center)";
104
	$l_lighttpd		= "WEB server (ALCASAR Control Center)";
104
	$l_sshd			= "Secure remote access";
105
	$l_sshd			= "Secure remote access";
105
	$l_clamav_freshclam	= "Antivirus update process (every 4 hours)";
106
	$l_clamav_freshclam	= "Antivirus update process (every 4 hours)";
106
	$l_clamav_daemon= "Antimalware";
107
	$l_clamav_daemon= "Antimalware";
107
	$l_ntpd			= "Network time server";
108
	$l_ntpd			= "Network time server";
-
 
109
	$l_postfix		= "E-mail service";
108
	$l_fail2ban		= "Intrusion Dectection System";
110
	$l_fail2ban		= "Intrusion Dectection System";
109
	$l_nfcapd		= "Netflow collector";
111
	$l_nfcapd		= "Netflow collector";
110
	$l_vnstat		= "Network grapher";
112
	$l_vnstat		= "Network grapher";
111
	$l_unbound		= "Main DNS server";
113
	$l_unbound		= "Main DNS server";
112
	$l_unbound_blacklist	= "Blacklist DNS server";
114
	$l_unbound_blacklist	= "Blacklist DNS server";
113
	$l_unbound_whitelist	= "Whitelist DNS server";
115
	$l_unbound_whitelist	= "Whitelist DNS server";
114
	$l_dnsmasq_whitelist	= "Whitelist DNS server (IPSET)";
116
	$l_dnsmasq_whitelist	= "Whitelist DNS server (IPSET)";
115
	$l_unbound_blackhole	= "Blackhole DNS server";
117
	$l_unbound_blackhole	= "Blackhole DNS server";
116
	$l_ulogd_ssh		= "SSH access logging process";
118
	$l_ulogd_ssh		= "SSH access logging process";
117
	$l_ulogd_ext_access	= "Extern access attempts logging process";
119
	$l_ulogd_ext_access	= "Extern access attempts logging process";
118
	$l_ulogd_traceability	= "Filtering WEB access logging process";
120
	$l_ulogd_traceability	= "Filtering WEB access logging process";
119
	$l_wifi4eu_id	= "Enter your network identifier";
121
	$l_wifi4eu_id	= "Enter your network identifier";
120
	$l_execute		= "Execute";
122
	$l_execute		= "Execute";
121
	$l_stop_restart		= "Halt and restart the system";
123
	$l_stop_restart		= "Halt and restart the system";
122
	$l_halt			= "Halt le system";
124
	$l_halt			= "Halt le system";
123
	$l_reboot		= "Restart the system";
125
	$l_reboot		= "Restart the system";
124
}
126
}
125
 
127
 
126
/****************************************************************
128
/****************************************************************
127
*	                   CONST				*
129
*	                   CONST				*
128
*****************************************************************/
130
*****************************************************************/
129
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
131
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
130
 
132
 
131
/********************************************************
133
/********************************************************
132
*			CONF FILE test 			*
134
*			CONF FILE test 			*
133
*********************************************************/
135
*********************************************************/
134
if (!file_exists(CONF_FILE)){
136
if (!file_exists(CONF_FILE)){
135
	exit("Fichier de configuration ".CONF_FILE." non présent");
137
	exit("Fichier de configuration ".CONF_FILE." non présent");
136
}
138
}
137
if (!is_readable(CONF_FILE)){
139
if (!is_readable(CONF_FILE)){
138
	exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
140
	exit("Vous n'avez pas les droits de lecture sur le fichier ".CONF_FILE);
139
}
141
}
140
$file_conf = fopen(CONF_FILE, 'r');
142
$file_conf = fopen(CONF_FILE, 'r');
141
if (!$file_conf) {
143
if (!$file_conf) {
142
	exit('Error opening the file '.CONF_FILE);
144
	exit('Error opening the file '.CONF_FILE);
143
}
145
}
144
while (!feof($file_conf)) {
146
while (!feof($file_conf)) {
145
	$buffer = fgets($file_conf, 4096);
147
	$buffer = fgets($file_conf, 4096);
146
	if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
148
	if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
147
		$tmp = explode('=', $buffer, 2);
149
		$tmp = explode('=', $buffer, 2);
148
		$conf[trim($tmp[0])] = trim($tmp[1]);
150
		$conf[trim($tmp[0])] = trim($tmp[1]);
149
	}
151
	}
150
}
152
}
151
fclose($file_conf);
153
fclose($file_conf);
152
$wifi4eu = $conf['WIFI4EU'];
154
$wifi4eu = $conf['WIFI4EU'];
153
$wifi4eu_code = $conf['WIFI4EU_CODE'];
155
$wifi4eu_code = $conf['WIFI4EU_CODE'];
154
// Doing an action on a service (start,stop or restart)
156
// Doing an action on a service (start,stop or restart)
155
function serviceExec($service, $action){
157
function serviceExec($service, $action){
156
	if (($action == "start")||($action == "stop")||($action == "restart")){
158
	if (($action == "start")||($action == "stop")||($action == "restart")){
157
		exec("sudo /usr/bin/systemctl $action ".escapeshellarg($service), $retval, $retstatus);
159
		exec("sudo /usr/bin/systemctl $action ".escapeshellarg($service), $retval, $retstatus);
158
		return $retstatus;
160
		return $retstatus;
159
	} else {
161
	} else {
160
		return false;
162
		return false;
161
	}
163
	}
162
}
164
}
163
 
165
 
164
// Testing if a service is active
166
// Testing if a service is active
165
function checkServiceStatus($service){
167
function checkServiceStatus($service){
166
	$response = false;
168
	$response = false;
167
	exec("sudo /usr/bin/systemctl is-active ".escapeshellarg("$service.service"), $retval);
169
	exec("sudo /usr/bin/systemctl is-active ".escapeshellarg("$service.service"), $retval);
168
	foreach( $retval as $val ) {
170
	foreach( $retval as $val ) {
169
		if ($val == "active"){
171
		if ($val == "active"){
170
			$response = true;
172
			$response = true;
171
			break;
173
			break;
172
		}
174
		}
173
	}
175
	}
174
	return $response;
176
	return $response;
175
}
177
}
176
 
178
 
177
//-------------------------------
179
//-------------------------------
178
// WIFI4EU
180
// WIFI4EU
179
//-------------------------------
181
//-------------------------------
180
if (isset($_POST['wifi4eu'])){
182
if (isset($_POST['wifi4eu'])){
181
	switch ($_POST['wifi4eu']){
183
	switch ($_POST['wifi4eu']){
182
		case 'on' :
184
		case 'on' :
183
			$network_code = trim($_POST['wifi4eu_id']);
185
			$network_code = trim($_POST['wifi4eu_id']);
184
		        if ($network_code == '') {
186
		        if ($network_code == '') {
185
				$network_code = '123e4567-e89b-12d3-a456-426655440000'; // WIFI4EU test code
187
				$network_code = '123e4567-e89b-12d3-a456-426655440000'; // WIFI4EU test code
186
			}
188
			}
187
			file_put_contents(CONF_FILE, preg_replace('/WIFI4EU_CODE=.*/', 'WIFI4EU_CODE='.$network_code, file_get_contents(CONF_FILE)));
189
			file_put_contents(CONF_FILE, preg_replace('/WIFI4EU_CODE=.*/', 'WIFI4EU_CODE='.$network_code, file_get_contents(CONF_FILE)));
188
			exec("sudo /usr/local/bin/alcasar-wifi4eu.sh -on");
190
			exec("sudo /usr/local/bin/alcasar-wifi4eu.sh -on");
189
		break;
191
		break;
190
		case 'off' :
192
		case 'off' :
191
			exec("sudo /usr/local/bin/alcasar-wifi4eu.sh -off");
193
			exec("sudo /usr/local/bin/alcasar-wifi4eu.sh -off");
192
		break;
194
		break;
193
	}
195
	}
194
	header('Location: '.$_SERVER['PHP_SELF']);
196
	header('Location: '.$_SERVER['PHP_SELF']);
195
}
197
}
196
 
198
 
197
//-------------------------------
199
//-------------------------------
198
// Stop/restart system
200
// Stop/restart system
199
//-------------------------------
201
//-------------------------------
200
if (isset($_POST['system'])){
202
if (isset($_POST['system'])){
201
	switch ($_POST['system']){
203
	switch ($_POST['system']){
202
		case 'reboot' :
204
		case 'reboot' :
203
			exec ("sudo /usr/local/bin/alcasar-logout.sh all");
205
			exec ("sudo /usr/local/bin/alcasar-logout.sh all");
204
			exec ("sudo /usr/sbin/shutdown -r now");
206
			exec ("sudo /usr/sbin/shutdown -r now");
205
		break;
207
		break;
206
		case 'halt' :
208
		case 'halt' :
207
			exec ("sudo /usr/local/bin/alcasar-logout.sh all");
209
			exec ("sudo /usr/local/bin/alcasar-logout.sh all");
208
			exec ("sudo /usr/sbin/shutdown -h now");
210
			exec ("sudo /usr/sbin/shutdown -h now");
209
		break;
211
		break;
210
	}
212
	}
211
}
213
}
212
 
214
 
213
//-------------------------------
215
//-------------------------------
214
// Actions on services
216
// Actions on services
215
//-------------------------------
217
//-------------------------------
216
$autorizeService = array("radiusd","chilli","mysqld","lighttpd","unbound-forward","ulogd-ssh","ulogd-ext-access","ulogd-traceability","unbound-blacklist","unbound-whitelist","dnsmasq-whitelist","unbound-blackhole","e2guardian","clamav-daemon","clamav-freshclam","sshd","ntpd","fail2ban","nfcapd","vnstat","postfix");
218
$autorizeService = array("radiusd","chilli","mysqld","lighttpd","unbound-forward","ulogd-ssh","ulogd-ext-access","ulogd-traceability","unbound-blacklist","unbound-whitelist","dnsmasq-whitelist","unbound-blackhole","e2guardian","clamav-daemon","clamav-freshclam","sshd","ntpd","fail2ban","nfcapd","vnstat","postfix");
217
$autorizeAction = array("start","stop","restart");
219
$autorizeAction = array("start","stop","restart");
218
 
220
 
219
if (isset($_GET['service'])&&(in_array($_GET['service'], $autorizeService))) {
221
if (isset($_GET['service'])&&(in_array($_GET['service'], $autorizeService))) {
220
    if (isset($_GET['action'])&&(in_array($_GET['action'], $autorizeAction))) {
222
    if (isset($_GET['action'])&&(in_array($_GET['action'], $autorizeAction))) {
221
    	$execStatus = serviceExec($_GET['service'], $_GET['action']);
223
    	$execStatus = serviceExec($_GET['service'], $_GET['action']);
222
		// execStatus non exploité
224
		// execStatus non exploité
223
	}
225
	}
224
}
226
}
225
 
227
 
226
//-------------------------------
228
//-------------------------------
227
// Check services status
229
// Check services status
228
//-------------------------------
230
//-------------------------------
229
$MainServiceStatus = array();
231
$MainServiceStatus = array();
230
$MainServiceStatus['chilli'] = checkServiceStatus("chilli");
232
$MainServiceStatus['chilli'] = checkServiceStatus("chilli");
231
$MainServiceStatus['radiusd'] = checkServiceStatus("radiusd");
233
$MainServiceStatus['radiusd'] = checkServiceStatus("radiusd");
232
$MainServiceStatus['mysqld'] = checkServiceStatus("mysqld");
234
$MainServiceStatus['mysqld'] = checkServiceStatus("mysqld");
233
$MainServiceStatus['lighttpd'] = checkServiceStatus("lighttpd");
235
$MainServiceStatus['lighttpd'] = checkServiceStatus("lighttpd");
234
$MainServiceStatus['unbound'] = checkServiceStatus("unbound");
236
$MainServiceStatus['unbound'] = checkServiceStatus("unbound");
235
$MainServiceStatus['nfcapd'] = checkServiceStatus("nfcapd");
237
$MainServiceStatus['nfcapd'] = checkServiceStatus("nfcapd");
236
$MainServiceStatus['ulogd_ssh'] = checkServiceStatus("ulogd-ssh");
238
$MainServiceStatus['ulogd_ssh'] = checkServiceStatus("ulogd-ssh");
237
$MainServiceStatus['ulogd_ext_access'] = checkServiceStatus("ulogd-ext-access");
239
$MainServiceStatus['ulogd_ext_access'] = checkServiceStatus("ulogd-ext-access");
238
$MainServiceStatus['ulogd_traceability'] = checkServiceStatus("ulogd-traceability");
240
$MainServiceStatus['ulogd_traceability'] = checkServiceStatus("ulogd-traceability");
239
$MainServiceStatus['sshd'] = checkServiceStatus("sshd");
241
$MainServiceStatus['sshd'] = checkServiceStatus("sshd");
240
$MainServiceStatus['ntpd'] = checkServiceStatus("ntpd");
242
$MainServiceStatus['ntpd'] = checkServiceStatus("ntpd");
241
$MainServiceStatus['fail2ban'] = checkServiceStatus("fail2ban");
243
$MainServiceStatus['fail2ban'] = checkServiceStatus("fail2ban");
242
$MainServiceStatus['vnstat'] = checkServiceStatus("vnstat");
244
$MainServiceStatus['vnstat'] = checkServiceStatus("vnstat");
243
$MainServiceStatus['postfix'] = checkServiceStatus("postfix");
245
$MainServiceStatus['postfix'] = checkServiceStatus("postfix");
244
 
246
 
245
$FilterServiceStatus = array();
247
$FilterServiceStatus = array();
246
$FilterServiceStatus['unbound_blacklist'] = checkServiceStatus("unbound-blacklist");
248
$FilterServiceStatus['unbound_blacklist'] = checkServiceStatus("unbound-blacklist");
247
$FilterServiceStatus['unbound_whitelist'] = checkServiceStatus("unbound-whitelist");
249
$FilterServiceStatus['unbound_whitelist'] = checkServiceStatus("unbound-whitelist");
248
$FilterServiceStatus['dnsmasq_whitelist'] = checkServiceStatus("dnsmasq-whitelist");
250
$FilterServiceStatus['dnsmasq_whitelist'] = checkServiceStatus("dnsmasq-whitelist");
249
$FilterServiceStatus['unbound_blackhole'] = checkServiceStatus("unbound-blackhole");
251
$FilterServiceStatus['unbound_blackhole'] = checkServiceStatus("unbound-blackhole");
250
$FilterServiceStatus['e2guardian'] = checkServiceStatus("e2guardian");
252
$FilterServiceStatus['e2guardian'] = checkServiceStatus("e2guardian");
251
$FilterServiceStatus['clamav_daemon'] = checkServiceStatus("clamav-daemon");
253
$FilterServiceStatus['clamav_daemon'] = checkServiceStatus("clamav-daemon");
252
$FilterServiceStatus['clamav_freshclam'] = checkServiceStatus("clamav-freshclam");
254
$FilterServiceStatus['clamav_freshclam'] = checkServiceStatus("clamav-freshclam");
253
 
255
 
254
/****************
256
/****************
255
*	MAIN	*
257
*	MAIN	*
256
*****************/
258
*****************/
257
 
259
 
258
?><!DOCTYPE HTML>
260
?><!DOCTYPE HTML>
259
<html>
261
<html>
260
<head>
262
<head>
261
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
263
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
262
	<title><?php echo $l_services_title; ?></title>
264
	<title><?php echo $l_services_title; ?></title>
263
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
265
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
264
	<script type="text/javascript" src="/js/jquery.min.js"></script>
266
	<script type="text/javascript" src="/js/jquery.min.js"></script>
265
</head>
267
</head>
266
<body>
268
<body>
267
<div id="ldoverlay" class="overlay">
269
<div id="ldoverlay" class="overlay">
268
	<div class="lds-spinner" id="spinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
270
	<div class="lds-spinner" id="spinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
269
</div>
271
</div>
270
<div class="panel">
272
<div class="panel">
271
	<div class="panel-header"><?= $l_main_services ?></div>
273
	<div class="panel-header"><?= $l_main_services ?></div>
272
	<div class="panel-row">
274
	<div class="panel-row">
273
	<table width="100%" border=0 cellspacing=0 cellpadding=0>
275
	<table width="100%" border=0 cellspacing=0 cellpadding=0>
274
		<tr align="center"><td><?php echo $l_service_status;?></td><td colspan="2"><?php echo $l_service_title;?></td><td colspan="3"><?php echo $l_service_action;?></td></tr>
276
		<tr align="center"><td><?php echo $l_service_status;?></td><td colspan="2"><?php echo $l_service_title;?></td><td colspan="3"><?php echo $l_service_action;?></td></tr>
275
		<?php foreach( $MainServiceStatus as $serviceName => $statusOK ) { ?>
277
		<?php foreach( $MainServiceStatus as $serviceName => $statusOK ) { ?>
276
		<tr>
278
		<tr>
277
		<?php if ($statusOK) { ?>
279
		<?php if ($statusOK) { ?>
278
			<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
280
			<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
279
			<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
281
			<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
280
			<td width="80" align="center">---</td>
282
			<td width="80" align="center">---</td>
281
			<td width="80" align="center"><?php if (($serviceName != "chilli") && ($serviceName != "lighttpd")) { echo "<a href=\"".$_SERVER['PHP_SELF']."?action=stop&service=".str_replace('_','-',$serviceName)."\"> $l_service_stop</a>"; } else echo "---";?></td>
283
			<td width="80" align="center"><?php if (($serviceName != "chilli") && ($serviceName != "lighttpd")) { echo "<a href=\"".$_SERVER['PHP_SELF']."?action=stop&service=".str_replace('_','-',$serviceName)."\"> $l_service_stop</a>"; } else echo "---";?></td>
282
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=restart&service=".str_replace('_','-',$serviceName)."\"> $l_service_restart";?></a></td>
284
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=restart&service=".str_replace('_','-',$serviceName)."\"> $l_service_restart";?></a></td>
283
		<?php } else { ?>
285
		<?php } else { ?>
284
			<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko ?>"></td>
286
			<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko ?>"></td>
285
			<td align="center"><?php $comment="l_$serviceName"; echo "$serviceName</td><td>${$comment}" ;?> </td>
287
			<td align="center"><?php $comment="l_$serviceName"; echo "$serviceName</td><td>${$comment}" ;?> </td>
286
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=start&service=".str_replace('_','-',$serviceName)."\"> $l_service_start";?></a></td>
288
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=start&service=".str_replace('_','-',$serviceName)."\"> $l_service_start";?></a></td>
287
			<td width="80" align="center">---</td>
289
			<td width="80" align="center">---</td>
288
			<td width="80" align="center">---</td>
290
			<td width="80" align="center">---</td>
289
		<?php } ?>
291
		<?php } ?>
290
		</tr>
292
		</tr>
291
		<?php } ?>
293
		<?php } ?>
292
	</table>
294
	</table>
293
	</div>
295
	</div>
294
</div>
296
</div>
295
<div class="panel">
297
<div class="panel">
296
	<div class="panel-header"><?= $l_filter_services ?></div>
298
	<div class="panel-header"><?= $l_filter_services ?></div>
297
	<div class="panel-row">
299
	<div class="panel-row">
298
	<table width="100%" border=0 cellspacing=0 cellpadding=0>
300
	<table width="100%" border=0 cellspacing=0 cellpadding=0>
299
		<tr align="center"><td><?php echo $l_service_status;?></td><td colspan="2"><?php echo $l_service_title;?></td><td colspan="3"><?php echo $l_service_action;?></td></tr>
301
		<tr align="center"><td><?php echo $l_service_status;?></td><td colspan="2"><?php echo $l_service_title;?></td><td colspan="3"><?php echo $l_service_action;?></td></tr>
300
		<!--	<TR align="center"> -->
302
		<!--	<TR align="center"> -->
301
		<?php foreach( $FilterServiceStatus as $serviceName => $statusOK ) { ?>
303
		<?php foreach( $FilterServiceStatus as $serviceName => $statusOK ) { ?>
302
		<tr>
304
		<tr>
303
		<?php if ($statusOK) { ?>
305
		<?php if ($statusOK) { ?>
304
			<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
306
			<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
305
			<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
307
			<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
306
			<td width="80" align="center">---</td>
308
			<td width="80" align="center">---</td>
307
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=stop&service=".str_replace('_','-',$serviceName)."\"> $l_service_stop";?></a></td>
309
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=stop&service=".str_replace('_','-',$serviceName)."\"> $l_service_stop";?></a></td>
308
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=restart&service=".str_replace('_','-',$serviceName)."\"> $l_service_restart";?></a></td>
310
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=restart&service=".str_replace('_','-',$serviceName)."\"> $l_service_restart";?></a></td>
309
			<?php } else { ?>
311
			<?php } else { ?>
310
			<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko ?>"></td>
312
			<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko ?>"></td>
311
			<td align="center"><?php $comment="l_$serviceName"; echo "$serviceName</td><td>${$comment}" ;?> </td>
313
			<td align="center"><?php $comment="l_$serviceName"; echo "$serviceName</td><td>${$comment}" ;?> </td>
312
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=start&service=".str_replace('_','-',$serviceName)."\"> $l_service_start";?></a></td>
314
			<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=start&service=".str_replace('_','-',$serviceName)."\"> $l_service_start";?></a></td>
313
			<td width="80" align="center">---</td>
315
			<td width="80" align="center">---</td>
314
			<td width="80" align="center">---</td>
316
			<td width="80" align="center">---</td>
315
			<?php } ?>
317
			<?php } ?>
316
		</tr>
318
		</tr>
317
		<?php } ?>
319
		<?php } ?>
318
	</table>
320
	</table>
319
	</div>
321
	</div>
320
</div>
322
</div>
321
<div class="panel">
323
<div class="panel">
322
	<div class="panel-header"><?= $l_opt_services ?></div>
324
	<div class="panel-header"><?= $l_opt_services ?></div>
323
	<div class="panel-row">
325
	<div class="panel-row">
324
	<form action="<?php echo $_SERVER['PHP_SELF']?>" method=POST>
326
	<form action="<?php echo $_SERVER['PHP_SELF']?>" method=POST>
325
	<table width="100%" border=0 cellspacing=0 cellpadding=0>
327
	<table width="100%" border=0 cellspacing=0 cellpadding=0>
326
		<tr align="center"><td><?php echo $l_service_status;?></td><td colspan="2"> </td><td colspan="3"><?php echo $l_service_action;?></td></tr>
328
		<tr align="center"><td><?php echo $l_service_status;?></td><td colspan="2"> </td><td colspan="3"><?php echo $l_service_action;?></td></tr>
327
		<tr>
329
		<tr>
328
			<?php if ($wifi4eu == "on") { ?>
330
			<?php if ($wifi4eu == "on") { ?>
329
			<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
331
			<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
330
			<td align="center"><b>WIFI4EU</b></td><td><?php echo "network ID : $wifi4eu_code"; ?></td>
332
			<td align="center"><b>WIFI4EU</b></td><td><?php echo "network ID : $wifi4eu_code"; ?></td>
331
			<td width="80" align="center">---</td>
333
			<td width="80" align="center">---</td>
332
			<td width="80" align="center"><input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?echo $l_service_stop;?>"><input type=hidden name="wifi4eu" value="off"></td>
334
			<td width="80" align="center"><input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?echo $l_service_stop;?>"><input type=hidden name="wifi4eu" value="off"></td>
333
			<td width="80" align="center">---</td>
335
			<td width="80" align="center">---</td>
334
			<?php } else { ?>
336
			<?php } else { ?>
335
			<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko; ?>"></td>
337
			<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko; ?>"></td>
336
			<td align="center">WIFI4EU</td><td><?php echo $l_wifi4eu_id; ?> : <input type ="text" name="wifi4eu_id" value="<?php echo $wifi4eu_code; ?>" size="40"></td>
338
			<td align="center">WIFI4EU</td><td><?php echo $l_wifi4eu_id; ?> : <input type ="text" name="wifi4eu_id" value="<?php echo $wifi4eu_code; ?>" size="40"></td>
337
			<td width="80" align="center"><input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?echo $l_service_start;?>"><input type=hidden name="wifi4eu" value="on"></td>
339
			<td width="80" align="center"><input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?echo $l_service_start;?>"><input type=hidden name="wifi4eu" value="on"></td>
338
			<td width="80" align="center">---</td>
340
			<td width="80" align="center">---</td>
339
			<td width="80" align="center">---</td>
341
			<td width="80" align="center">---</td>
340
			<?php } ?>
342
			<?php } ?>
341
		</tr>
343
		</tr>
342
	</table>
344
	</table>
343
	</form>
345
	</form>
344
	</div>
346
	</div>
345
</div>
347
</div>
346
<div class="panel">
348
<div class="panel">
347
	<div class="panel-header"><?= $l_stop_restart ?></div>
349
	<div class="panel-header"><?= $l_stop_restart ?></div>
348
	<div class="panel-row">
350
	<div class="panel-row">
349
	<table width="100%" border=0 cellspacing=0 cellpadding=1>
351
	<table width="100%" border=0 cellspacing=0 cellpadding=1>
350
		<tr><td valign="middle" align="left">
352
		<tr><td valign="middle" align="left">
351
			<form action="<?php echo $_SERVER['PHP_SELF']?>" method=POST>
353
			<form action="<?php echo $_SERVER['PHP_SELF']?>" method=POST>
352
			<select name='system'>
354
			<select name='system'>
353
				<option selected value="reboot"><?echo "$l_reboot";?>
355
				<option selected value="reboot"><?echo "$l_reboot";?>
354
				<option value="halt"><?echo "$l_halt";?>
356
				<option value="halt"><?echo "$l_halt";?>
355
			</select>
357
			</select>
356
			<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?echo "$l_execute";?>">
358
			<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?echo "$l_execute";?>">
357
			</form>
359
			</form>
358
		</td></tr>
360
		</td></tr>
359
	</table>
361
	</table>
360
	</div>
362
	</div>
361
</div>
363
</div>
362
</body>
364
</body>
363
</html>
365
</html>
364
 
366