Line 6... |
Line 6... |
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_network_title = "Configuration réseau";
|
10 |
$l_network_title = "Configuration réseau";
|
11 |
$l_process_title = "État des services réseau pricipaux";
|
11 |
$l_main_services = "Services réseau pricipaux";
|
- |
|
12 |
$l_opt_services = "Services réseau optionnels";
|
12 |
$l_eth0_legend = "Eth0 (Interface connectée à Internet)";
|
13 |
$l_eth0_legend = "Eth0 (Interface connectée à Internet)";
|
13 |
$l_eth1_legend = "Eth1 (Réseau de consultation)";
|
14 |
$l_eth1_legend = "Eth1 (Réseau de consultation)";
|
14 |
$l_internet_legend = "INTERNET";
|
15 |
$l_internet_legend = "INTERNET";
|
15 |
$l_ip_adr = "Adresse IP";
|
16 |
$l_ip_adr = "Adresse IP";
|
16 |
$l_ip_mask = "Masque";
|
17 |
$l_ip_mask = "Masque";
|
Line 28... |
Line 29... |
28 |
$l_disable = "inactif";
|
29 |
$l_disable = "inactif";
|
29 |
$l_radiusd = "Serveur d'authentification et d'autorisation";
|
30 |
$l_radiusd = "Serveur d'authentification et d'autorisation";
|
30 |
$l_chilli = "Passerelle d'interception";
|
31 |
$l_chilli = "Passerelle d'interception";
|
31 |
$l_dansguardian = "Filtre d'URL et de contenu WEB";
|
32 |
$l_dansguardian = "Filtre d'URL et de contenu WEB";
|
32 |
$l_mysqld = "Serveur de la base de données usager";
|
33 |
$l_mysqld = "Serveur de la base de données usager";
|
33 |
$l_squid = "Proxy Cache WEB";
|
34 |
$l_squid = "Serveur de cache WEB";
|
34 |
$l_dnsmasq = "Serveur DNS et filtre de domaine";
|
35 |
$l_dnsmasq = "Serveur DNS et filtre de domaine";
|
35 |
$l_httpd = "Serveur WEB (Centre de Gestion d'ALCASAR)";
|
36 |
$l_httpd = "Serveur WEB (Centre de Gestion d'ALCASAR)";
|
36 |
$l_havp = "Filtre antivirus WEB";
|
37 |
$l_havp = "Filtre antivirus WEB";
|
37 |
$l_sshd = "Accès sécurisée à distance";
|
38 |
$l_sshd = "Accès sécurisée à distance";
|
- |
|
39 |
$l_freshclam = "Mise à jour de l'antivirus toutes les 2 heures";
|
- |
|
40 |
$l_ntpd = "Service de mise à l'heure réseau";
|
38 |
} else {
|
41 |
} else {
|
39 |
$l_network_title = "Network configuration";
|
42 |
$l_network_title = "Network configuration";
|
40 |
$l_process_title = "Main network processes state";
|
43 |
$l_main_services = "Main network services";
|
- |
|
44 |
$l_opt_services = "Optional network services";
|
41 |
$l_eth0_legend = "Eth0 (Internet connected interface)";
|
45 |
$l_eth0_legend = "Eth0 (Internet connected interface)";
|
42 |
$l_eth1_legend = "Eth1 (Private network)";
|
46 |
$l_eth1_legend = "Eth1 (Private network)";
|
43 |
$l_internet_legend = "INTERNET";
|
47 |
$l_internet_legend = "INTERNET";
|
44 |
$l_ip_adr = "IP Address";
|
48 |
$l_ip_adr = "IP Address";
|
45 |
$l_ip_mask = "Mask";
|
49 |
$l_ip_mask = "Mask";
|
Line 62... |
Line 66... |
62 |
$l_squid = "Proxy Cache WEB";
|
66 |
$l_squid = "Proxy Cache WEB";
|
63 |
$l_dnsmasq = "DNS and domain name filter";
|
67 |
$l_dnsmasq = "DNS and domain name filter";
|
64 |
$l_httpd = "WEB server (ALCASAR Control Center)";
|
68 |
$l_httpd = "WEB server (ALCASAR Control Center)";
|
65 |
$l_havp = "WEB antivirus filter";
|
69 |
$l_havp = "WEB antivirus filter";
|
66 |
$l_sshd = "Secure remote access";
|
70 |
$l_sshd = "Secure remote access";
|
- |
|
71 |
$l_freshclam = "WEB antivirus update (every 2 hours)";
|
- |
|
72 |
$l_ntpd = "Network time";
|
67 |
}
|
73 |
}
|
68 |
|
74 |
|
69 |
/********************************************************************
|
75 |
/********************************************************************
|
70 |
* CONSTANTES AVEC CHEMINS DES FICHIERS DE CONFIGURATION *
|
76 |
* CONSTANTES AVEC CHEMINS DES FICHIERS DE CONFIGURATION *
|
71 |
*********************************************************************/
|
77 |
*********************************************************************/
|
Line 120... |
Line 126... |
120 |
|
126 |
|
121 |
//-------------------------------
|
127 |
//-------------------------------
|
122 |
// Les actions sur un service
|
128 |
// Les actions sur un service
|
123 |
//-------------------------------
|
129 |
//-------------------------------
|
124 |
//sécurité sur les actions à réaliser
|
130 |
//sécurité sur les actions à réaliser
|
125 |
$autorizeService = array("radiusd","chilli","dansguardian","mysqld","squid","dnsmasq","httpd","havp","sshd");
|
131 |
$autorizeService = array("radiusd","chilli","dansguardian","mysqld","squid","dnsmasq","httpd","havp","sshd","freshclam","ntpd");
|
126 |
$autorizeAction = array("start","stop","restart");
|
132 |
$autorizeAction = array("start","stop","restart");
|
127 |
|
133 |
|
128 |
if (isset($_GET['service'])&&(in_array($_GET['service'], $autorizeService))) {
|
134 |
if (isset($_GET['service'])&&(in_array($_GET['service'], $autorizeService))) {
|
129 |
if (isset($_GET['action'])&&(in_array($_GET['action'], $autorizeAction))) {
|
135 |
if (isset($_GET['action'])&&(in_array($_GET['action'], $autorizeAction))) {
|
130 |
$execStatus = serviceExec($_GET['service'], $_GET['action']);
|
136 |
$execStatus = serviceExec($_GET['service'], $_GET['action']);
|
Line 132... |
Line 138... |
132 |
}
|
138 |
}
|
133 |
}
|
139 |
}
|
134 |
//-------------------------------
|
140 |
//-------------------------------
|
135 |
//recherche du status des services
|
141 |
//recherche du status des services
|
136 |
//-------------------------------
|
142 |
//-------------------------------
|
137 |
$serviceStatus = array();
|
143 |
$MainServiceStatus = array();
|
138 |
$serviceStatus['radiusd'] = checkServiceStatus("radiusd","pid");
|
144 |
$MainServiceStatus['radiusd'] = checkServiceStatus("radiusd","pid");
|
139 |
$serviceStatus['chilli'] = checkServiceStatus("chilli","pid");
|
145 |
$MainServiceStatus['chilli'] = checkServiceStatus("chilli","pid");
|
140 |
$serviceStatus['dansguardian'] = checkServiceStatus("dansguardian","pid");
|
146 |
$MainServiceStatus['dansguardian'] = checkServiceStatus("dansguardian","pid");
|
141 |
$serviceStatus['mysqld'] = checkServiceStatus("mysqld","OK");
|
147 |
$MainServiceStatus['mysqld'] = checkServiceStatus("mysqld","OK");
|
142 |
$serviceStatus['squid'] = checkServiceStatus("squid","pid");
|
148 |
$MainServiceStatus['squid'] = checkServiceStatus("squid","pid");
|
143 |
$serviceStatus['dnsmasq'] = checkServiceStatus("dnsmasq","pid");
|
149 |
$MainServiceStatus['dnsmasq'] = checkServiceStatus("dnsmasq","pid");
|
144 |
$serviceStatus['httpd'] = checkServiceStatus("httpd","pid");
|
150 |
$MainServiceStatus['httpd'] = checkServiceStatus("httpd","pid");
|
145 |
$serviceStatus['havp'] = checkServiceStatus("havp","pid");
|
151 |
$MainServiceStatus['havp'] = checkServiceStatus("havp","pid");
|
- |
|
152 |
|
- |
|
153 |
$OptServiceStatus = array();
|
146 |
$serviceStatus['sshd'] = checkServiceStatus("sshd","pid");
|
154 |
$OptServiceStatus['sshd'] = checkServiceStatus("sshd","pid");
|
- |
|
155 |
$OptServiceStatus['freshclam'] = checkServiceStatus("freshclam","pid");
|
- |
|
156 |
$OptServiceStatus['ntpd'] = checkServiceStatus("ntpd","pid");
|
147 |
|
157 |
|
148 |
// Fonction de test de connectivité internet
|
158 |
// Fonction de test de connectivité internet
|
149 |
function internetTest(){
|
159 |
function internetTest(){
|
150 |
$host = "www.google.fr";
|
160 |
$host = "www.google.fr";
|
151 |
$port = "80";
|
161 |
$port = "80";
|
Line 267... |
Line 277... |
267 |
</table>
|
277 |
</table>
|
268 |
</fieldset>
|
278 |
</fieldset>
|
269 |
</td></tr>
|
279 |
</td></tr>
|
270 |
</table>
|
280 |
</table>
|
271 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
281 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
272 |
<tr><th><?php echo $l_process_title; ?></th></tr>
|
282 |
<tr><th><?php echo $l_main_services; ?></th></tr>
|
- |
|
283 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
- |
|
284 |
</table>
|
- |
|
285 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
|
- |
|
286 |
<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>
|
- |
|
287 |
<TR align="center">
|
- |
|
288 |
<?php foreach( $MainServiceStatus as $serviceName => $statusOK ) { ?>
|
- |
|
289 |
<tr>
|
- |
|
290 |
<?php if ($statusOK) { ?>
|
- |
|
291 |
<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
|
- |
|
292 |
<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
|
- |
|
293 |
<td width="80" align="center">---</td>
|
- |
|
294 |
<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=stop&service=$serviceName\"> $l_service_stop";?></a></td>
|
- |
|
295 |
<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=restart&service=$serviceName\"> $l_service_restart";?></a></td>
|
- |
|
296 |
<?php } else { ?>
|
- |
|
297 |
<td align="center"><img src="/images/state_error.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ko ?>"></td>
|
- |
|
298 |
<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
|
- |
|
299 |
<td width="80" align="center"><a href="<?php echo $_SERVER['PHP_SELF']."?action=start&service=$serviceName\"> $l_service_start";?></a></td>
|
- |
|
300 |
<td width="80" align="center">---</td>
|
- |
|
301 |
<td width="80" align="center">---</td>
|
- |
|
302 |
<?php } ?>
|
- |
|
303 |
</tr>
|
- |
|
304 |
<?php } ?>
|
- |
|
305 |
</td></tr>
|
- |
|
306 |
</table>
|
- |
|
307 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
- |
|
308 |
<tr><th><?php echo $l_opt_services; ?></th></tr>
|
273 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
309 |
<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
|
274 |
</table>
|
310 |
</table>
|
275 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
|
311 |
<TABLE width="100%" border=1 cellspacing=0 cellpadding=0>
|
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>
|
312 |
<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>
|
277 |
<TR align="center">
|
313 |
<TR align="center">
|
278 |
<?php foreach( $serviceStatus as $serviceName => $statusOK ) { ?>
|
314 |
<?php foreach( $OptServiceStatus as $serviceName => $statusOK ) { ?>
|
279 |
<tr>
|
315 |
<tr>
|
280 |
<?php if ($statusOK) { ?>
|
316 |
<?php if ($statusOK) { ?>
|
281 |
<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
|
317 |
<td align="center"><img src="/images/state_ok.gif" width="15" height="15" alt="<?php echo $l_service_status_img_ok; ?>"></td>
|
282 |
<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
|
318 |
<td align="center"><?php $comment="l_$serviceName"; echo "<b>$serviceName</b></td><td>${$comment}" ;?> </td>
|
283 |
<td width="80" align="center">---</td>
|
319 |
<td width="80" align="center">---</td>
|