Subversion Repositories ALCASAR

Rev

Rev 3042 | Rev 3049 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 3042 Rev 3046
Line 1... Line 1...
1
<?php
1
<?php
2
# $Id: network.php 3042 2022-07-22 12:35:45Z rexy $
2
# $Id: network.php 3046 2022-07-30 22:07:33Z rexy $
3
 
-
 
4
// written by steweb57, Rexy, Tom HOUDAYER & Pierre RIVAULT
3
// written by steweb57, Rexy, Tom HOUDAYER & Pierre RIVAULT
5
 
4
 
6
/********************
5
/********************
7
*  READ CONF FILES  *
6
*  READ CONF FILES  *
8
*********************/
7
*********************/
Line 81... Line 80...
81
	$l_ssh_title		= "SSH";
80
	$l_ssh_title		= "SSH";
82
	$l_ssh_port			= "Port";
81
	$l_ssh_port			= "Port";
83
	$l_ssh_from			= "IP autorisée";
82
	$l_ssh_from			= "IP autorisée";
84
	$l_ssh_wan_activate	= "Activer SSH sur WAN";
83
	$l_ssh_wan_activate	= "Activer SSH sur WAN";
85
	$l_ssh_lan_activate	= "Activer SSH sur LAN";
84
	$l_ssh_lan_activate	= "Activer SSH sur LAN";
-
 
85
	$l_interlan_title = "Autoriser l'accès au réseau situé entre ALCASAR et le routeur d'accès à Internet";
86
	$l_cert_expiration	= "Date d'expiration :";
86
	$l_cert_expiration	= "Date d'expiration :";
87
	$l_cert_commonname	= "Nom commun :";
87
	$l_cert_commonname	= "Nom commun :";
88
	$l_cert_organization	= "Organisation :";
88
	$l_cert_organization	= "Organisation :";
89
	$l_upload_certificate	= "Importer un certificat officiel";
89
	$l_upload_certificate	= "Importer un certificat officiel";
90
	$l_le_integration	= "Intégrer un certificat Let's Encrypt";
90
	$l_le_integration	= "Intégrer un certificat Let's Encrypt";
Line 149... Line 149...
149
	$l_ssh_title		= "SSH";
149
	$l_ssh_title		= "SSH";
150
	$l_ssh_port			= "Puerto";
150
	$l_ssh_port			= "Puerto";
151
	$l_ssh_from			= "IP autorizada";
151
	$l_ssh_from			= "IP autorizada";
152
	$l_ssh_wan_activate	= "Activar SSH on WAN";
152
	$l_ssh_wan_activate	= "Activar SSH on WAN";
153
	$l_ssh_lan_activate	= "Activar SSH on LAN";
153
	$l_ssh_lan_activate	= "Activar SSH on LAN";
-
 
154
	$l_interlan_title = "Permitir el acceso a la red entre ALCASAR y el router de acceso a Internet";
154
	$l_cert_expiration	= "Fecha de vencimiento:";
155
	$l_cert_expiration	= "Fecha de vencimiento:";
155
	$l_cert_commonname	= "Common name:";
156
	$l_cert_commonname	= "Common name:";
156
	$l_cert_organization	= "Organización:";
157
	$l_cert_organization	= "Organización:";
157
	$l_upload_certificate	= "Importar un certificado";
158
	$l_upload_certificate	= "Importar un certificado";
158
	$l_le_integration	= "Integración con Let's Encrypt";
159
	$l_le_integration	= "Integración con Let's Encrypt";
Line 216... Line 217...
216
	$l_ssh_title		= "SSH";
217
	$l_ssh_title		= "SSH";
217
	$l_ssh_port			= "Port";
218
	$l_ssh_port			= "Port";
218
	$l_ssh_from			= "Authorized IP";
219
	$l_ssh_from			= "Authorized IP";
219
	$l_ssh_wan_activate	= "Activate SSH on WAN";
220
	$l_ssh_wan_activate	= "Activate SSH on WAN";
220
	$l_ssh_lan_activate	= "Activate SSH on LAN";
221
	$l_ssh_lan_activate	= "Activate SSH on LAN";
-
 
222
	$l_interlan_title = "Authorize access to the network located between ALCASAR and Internet broadband router";
221
	$l_cert_expiration	= "Expiration date:";
223
	$l_cert_expiration	= "Expiration date:";
222
	$l_cert_commonname	= "Common name:";
224
	$l_cert_commonname	= "Common name:";
223
	$l_cert_organization	= "Organization:";
225
	$l_cert_organization	= "Organization:";
224
	$l_upload_certificate	= "Import an officlal certificate";
226
	$l_upload_certificate	= "Import an officlal certificate";
225
	$l_le_integration	= "Integrate a Let's Encrypt certificate";
227
	$l_le_integration	= "Integrate a Let's Encrypt certificate";
Line 411... Line 413...
411
		} else {
413
		} else {
412
			exec('sudo /usr/local/bin/alcasar-https.sh --off');
414
			exec('sudo /usr/local/bin/alcasar-https.sh --off');
413
		}
415
		}
414
		header('Location: '.$_SERVER['PHP_SELF']);
416
		header('Location: '.$_SERVER['PHP_SELF']);
415
		exit();
417
		exit();
-
 
418
	case 'interlan':
-
 
419
		$CONF_FILE = CONF_FILE;
-
 
420
		if (isset($_POST['interlan']))	 {
-
 
421
			exec('/bin/sed -i "s/^INTERLAN=.*/INTERLAN=on/g"'.$CONF_FILE);
-
 
422
		} else {
-
 
423
			exec('/bin/sed -i "s/^INTERLAN=.*/INTERLAN=off/g" '.$CONF_FILE);
-
 
424
		}
-
 
425
		exec('sudo /usr/local/bin/alcasar-iptables.sh');
-
 
426
		header('Location: '.$_SERVER['PHP_SELF']);
-
 
427
		exit();
416
}
428
}
417
 
429
 
418
// Network changes
430
// Network changes
419
if ($choix === 'network_change') {
431
if ($choix === 'network_change') {
420
    exec('sudo /usr/local/bin/alcasar-network.sh --save');
432
    exec('sudo /usr/local/bin/alcasar-network.sh --save');
Line 1196... Line 1208...
1196
			<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?= $l_apply ?>"><br>
1208
			<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?= $l_apply ?>"><br>
1197
		</form>
1209
		</form>
1198
	</div>
1210
	</div>
1199
</div>
1211
</div>
1200
<br>
1212
<br>
-
 
1213
<div class="panel">
-
 
1214
	<div class="panel-header"><?= $l_interlan_title ?></div>
-
 
1215
	<div class="panel-row">
-
 
1216
		<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
-
 
1217
			<input type="hidden" name="choix" value="interlan">
-
 
1218
			<input type="checkbox" name="interlan" id="interlan" <?= ($conf['INTERLAN'] === 'on')? "checked": "" ?>><b><?= $l_interlan_title ?></b><br>
-
 
1219
			<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="<?= $l_apply ?>"><br>
-
 
1220
		</form>
-
 
1221
	</div>
-
 
1222
</div>
-
 
1223
<br>
1201
<div class="panel">
1224
<div class="panel">
1202
	<div class="panel-header"><?= $l_ssh_title ?></div>
1225
	<div class="panel-header"><?= $l_ssh_title ?></div>
1203
	<table width="100%" cellspacing="0" cellpadding="5" border="1">
1226
	<table width="100%" cellspacing="0" cellpadding="5" border="1">
1204
	<tr>
1227
	<tr>
1205
		<td width="50%" align="center">
1228
		<td width="50%" align="center">