Subversion Repositories ALCASAR

Rev

Rev 2404 | Rev 2479 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
318 richard 1
<?php
2304 tom.houday 2
# $Id: network.php 2450 2017-12-05 21:53:42Z tom.houdayer $
3
 
2316 tom.houday 4
// written by steweb57, Rexy & Tom HOUDAYER
318 richard 5
 
861 richard 6
/********************
2316 tom.houday 7
*  READ CONF FILES  *
861 richard 8
*********************/
2316 tom.houday 9
define('CONF_FILE', '/usr/local/etc/alcasar.conf');
10
define('ETHERS_FILE', '/usr/local/etc/alcasar-ethers');
11
define('ETHERS_INFO_FILE', '/usr/local/etc/alcasar-ethers-info');
12
define('DNS_LOCAL_FILE', '/usr/local/etc/alcasar-dns-name');
2304 tom.houday 13
define('LETS_ENCRYPT_FILE', '/usr/local/etc/alcasar-letsencrypt');
2316 tom.houday 14
$conf_files = [CONF_FILE, ETHERS_FILE, ETHERS_INFO_FILE, DNS_LOCAL_FILE, LETS_ENCRYPT_FILE];
15
 
16
// Files reading test
17
foreach ($conf_files as $file) {
18
	if (!file_exists($file)) {
19
		exit("Requested file $file isn't present");
20
	}
21
	if (!is_readable($file)) {
22
		exit("Can't read the file $file");
23
	}
841 richard 24
}
2316 tom.houday 25
 
26
// Read ALCASAR CONF_FILE
27
$file_conf = fopen(CONF_FILE, 'r');
28
if (!$file_conf) {
29
	exit('Error opening the file '.CONF_FILE);
30
}
31
while (!feof($file_conf)) {
32
	$buffer = fgets($file_conf, 4096);
33
	if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
2450 tom.houday 34
		$tmp = explode('=', $buffer, 2);
2316 tom.houday 35
		$conf[trim($tmp[0])] = trim($tmp[1]);
36
	}
37
}
38
fclose($file_conf);
39
 
40
// Choice of language
318 richard 41
$Language = 'en';
2316 tom.houday 42
if (isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
43
	$Langue	  = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
44
	$Language = strtolower(substr(chop($Langue[0]), 0, 2));
45
}
46
if ($Language === 'fr') {	// French
318 richard 47
	$l_network_title	= "Configuration réseau";
48
	$l_internet_legend	= "INTERNET";
1733 richard 49
	$l_ip_mask		= "Masque";
318 richard 50
	$l_ip_router		= "Passerelle";
736 franck 51
	$l_ip_public		= "Adresse IP publique";
2316 tom.houday 52
	$l_ip_dns1		= "DNS n°1";
53
	$l_ip_dns2		= "DNS n°2";
861 richard 54
	$l_dhcp_title		= "Service DHCP";
862 richard 55
	$l_dhcp_state		= "Mode actuel";
1484 richard 56
	$l_DHCP_on		= "actif";
57
	$l_DHCP_off		= "inactif";
2304 tom.houday 58
	$l_DHCP_off_explain	= "/!\\ Avant d'arrêter le serveur DHCP, vous devez renseigner les paramètres d'un serveur externe (cf. documentation).";
841 richard 59
	$l_static_dhcp_title	= "Réservation d'adresses IP statiques";
60
	$l_mac_address		= "Adresse MAC";
61
	$l_ip_address		= "Adresse IP";
1959 richard 62
	$l_host_name		= "Nom d'hôte";
63
	$l_del			= "Supprimer de la liste";
841 richard 64
	$l_add_to_list		= "Ajouter";
1733 richard 65
	$l_apply		= "Appliquer les changements";
1959 richard 66
	$l_local_dns		= "Résolution local de nom";
1733 richard 67
	$l_import_cert		= "Import de certificat";
68
	$l_private_key		= "Clé privée (.key) :";
69
	$l_certificate		= "Certificat (.crt) :";
1740 richard 70
	$l_server_chain		= "Chaîne de certification (si nécéssaire : .crt) :";
71
	$l_default_cert		= "Revenir au certificat d'origine";
72
	$l_import		= "Importer";
1743 clement.si 73
	$l_current_certificate  = "Certificat actuel";
74
	$l_validated		= "Validé par :";
2316 tom.houday 75
	$l_empty		= "Vide";
2326 tom.houday 76
	$l_yes			= "Oui";
77
	$l_no			= "Non";
78
	$l_allow_unsecured_login	= "Autoriser les utilisateurs à se connecter de manière non sécurisée (HTTP) :";
79
	$l_unsecured_login_warning	= "/!\\ Les identifiants de connexion seront envoyés en clair.";
80
	$l_cert_expiration	= "Date d'expiration :";
2380 tom.houday 81
	$l_cert_commonname	= "Nom commun :";
82
	$l_cert_organization	= "Organisation :";
2326 tom.houday 83
	$l_upload_certificate	= "Importer un certificat";
84
	$l_le_integration	= "Intégration Let's Encrypt";
85
	$l_le_status		= "Status :";
86
	$l_disabled		= "Inactif";
87
	$l_pending_validation	= "En attente de validation";
88
	$l_enabled		= "Actif";
89
	$l_le_email		= "Email :";
90
	$l_le_domain_name	= "Nom de domaine :";
91
	$l_send			= "Envoyer";
92
	$l_le_ask_on		= "Demandé le :";
93
	$l_le_dns_entry_txt	= "Entrée DNS TXT :";
94
	$l_le_challenge		= "Challenge :";
95
	$l_recheck		= "Revérifier";
96
	$l_cancel		= "Annuler";
97
	$l_le_api		= "API :";
98
	$l_le_next_renewal	= "Prochain renouvellement :";
99
	$l_renew		= "Renouveller";
100
	$l_renew_force		= "Renouveller (forcer)";
2316 tom.houday 101
} else {			// English
318 richard 102
	$l_network_title	= "Network configuration";
103
	$l_internet_legend	= "INTERNET";
1733 richard 104
	$l_ip_mask		= "Mask";
841 richard 105
	$l_ip_router		= "Gateway";
318 richard 106
	$l_ip_public		= "Public IP address";
2316 tom.houday 107
	$l_ip_dns1		= "DNS n°1";
108
	$l_ip_dns2		= "DNS n°2";
861 richard 109
	$l_dhcp_title		= "DHCP service";
862 richard 110
	$l_dhcp_state		= "Current mode";
1484 richard 111
	$l_DHCP_on		= "enabled";
112
	$l_DHCP_off		= "disabled";
2304 tom.houday 113
	$l_DHCP_off_explain	= "/!\\ Before disabling the DHCP server, you must write the extern DHCP parameters in the config file (see Documentation)";
841 richard 114
	$l_static_dhcp_title	= "Static IP addresses reservation";
115
	$l_mac_address		= "MAC Address";
116
	$l_ip_address		= "IP Address";
1959 richard 117
	$l_host_name		= "Host name";
118
	$l_del			= "Delete from list";
841 richard 119
	$l_add_to_list		= "Add";
1733 richard 120
	$l_apply		= "Apply changes";
1959 richard 121
	$l_local_dns		= "Local name resolution";
1733 richard 122
	$l_import_cert		= "Certificate import";
123
	$l_private_key		= "Private key (.key) :";
124
	$l_certificate		= "Certificate (.crt) :";
1740 richard 125
	$l_server_chain		= "Server-chain (if necessary : .crt) :";
1733 richard 126
	$l_default_cert		= "Back to default certificate";
1740 richard 127
	$l_import		= "Import";
1743 clement.si 128
	$l_current_certificate  = "Current certificate";
129
	$l_validated		= "Validated by :";
2316 tom.houday 130
	$l_empty		= "Empty";
2326 tom.houday 131
	$l_yes			= "Yes";
132
	$l_no			= "No";
133
	$l_allow_unsecured_login	= "Allow users to login with insecure connection (HTTP):";
134
	$l_unsecured_login_warning	= "/!\\ Credentials will be sent in plain text.";
135
	$l_cert_expiration	= "Expiration date:";
136
	$l_cert_commonname	= "Common name:";
137
	$l_cert_organization	= "Organization:";
138
	$l_upload_certificate	= "Importer un certificat";
139
	$l_le_integration	= "Let's Encrypt integration";
140
	$l_le_status		= "Status:";
141
	$l_disabled		= "Disabled";
142
	$l_pending_validation	= "Pending validation";
143
	$l_enabled		= "Enabled";
144
	$l_le_email		= "Email:";
145
	$l_le_domain_name	= "Domain name:";
146
	$l_send			= "Send";
147
	$l_le_ask_on		= "Ask on:";
148
	$l_le_dns_entry_txt	= "DNS TXT entry:";
149
	$l_le_challenge		= "Challenge:";
150
	$l_recheck		= "Recheck";
151
	$l_cancel		= "Cancel";
152
	$l_le_api		= "API:";
153
	$l_le_next_renewal	= "Next renewal:";
154
	$l_renew		= "Renew";
155
	$l_renew_force		= "Renew (force)";
318 richard 156
}
2316 tom.houday 157
 
158
$reg_ip      = '/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/';
159
$reg_ip_cidr = '/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$/';
2380 tom.houday 160
$reg_mac     = '/^([0-9A-Fa-f]{2}[:-]){5}([0-9A-Fa-f]{2})$/';
161
$reg_host    = '/^[a-zA-Z0-9-_]+$/';
2316 tom.houday 162
 
163
$choix = (isset($_POST['choix'])) ? $_POST['choix'] : '';
164
 
165
switch ($choix) {
166
	case 'DHCP_On':
167
		exec('sudo /usr/local/bin/alcasar-dhcp.sh -on');
168
		break;
169
	case 'DHCP_Off':
170
		exec('sudo /usr/local/bin/alcasar-dhcp.sh -off');
171
		break;
172
 
173
	case 'new_mac':
2380 tom.houday 174
		$new_mac_addr = trim($_POST['add_mac']);
175
		$new_ip_addr  = trim($_POST['add_ip']);
176
		if (((!empty($new_mac_addr)) && (preg_match($reg_mac, $new_mac_addr))) && ((!empty($new_ip_addr)) && (preg_match($reg_ip, $new_ip_addr)))) {
2316 tom.houday 177
			$tab = file(ETHERS_FILE);
178
			if ($tab) { // the file isn't empty
179
				$insert = true;
180
				foreach ($tab as $line) { // verify that MAC or IP address doesn't exist
181
					$field = explode(' ', $line);
182
					$mac_addr = trim($field[0]);
183
					$ip_addr  = trim($field[1]);
184
					if (strcasecmp($new_mac_addr, $mac_addr) === 0) {
185
						$insert = false;
186
						break;
841 richard 187
					}
2316 tom.houday 188
					if (strcasecmp($new_ip_addr, $ip_addr) === 0) {
189
						$insert = false;
190
						break;
841 richard 191
					}
192
				}
2316 tom.houday 193
				if ($insert) {
194
					$line = $new_mac_addr . ' ' . $new_ip_addr . "\n";
195
					$pointeur = fopen(ETHERS_FILE, 'a');
196
					fwrite($pointeur, $line);
197
					fclose($pointeur);
198
					$pointeur = fopen(ETHERS_INFO_FILE, 'a');
199
					$line = "$new_mac_addr $new_ip_addr #" . trim($_POST['info'],"\x00..\x20") . "\n";
200
					fwrite($pointeur, $line);
201
					fclose($pointeur);
202
					exec('sudo /usr/bin/systemctl reload chilli');
1959 richard 203
				}
841 richard 204
			}
1959 richard 205
		}
2316 tom.houday 206
		break;
207
	case 'del_mac':
208
		foreach ($_POST as $key => $value) {
209
			if ($value == 'on') {
210
				$ether_file = ETHERS_FILE;
211
				$ether_file_info = ETHERS_INFO_FILE;
212
				exec("/bin/sed -i ".escapeshellarg("/^$key/d")." $ether_file"); 
213
				exec("/bin/sed -i ".escapeshellarg("/^$key/d")." $ether_file_info"); 
214
				exec('sudo /usr/bin/systemctl reload chilli');
841 richard 215
			}
216
		}
2316 tom.houday 217
		break;
218
 
219
	case 'new_host':
2380 tom.houday 220
		$add_host = trim($_POST['add_host']);
221
		$add_ip   = trim($_POST['add_ip']);
222
		if (((!empty($add_host)) && (preg_match($reg_host, $add_host))) && ((!empty($add_ip)) && (preg_match($reg_ip, $add_ip)))) {
2316 tom.houday 223
			$tab = file(DNS_LOCAL_FILE);
224
			if ($tab) { // the file isn't empty
225
				$insert = true;
226
				foreach ($tab as $line) { // verify that host or IP address doesn't exist
227
					if (preg_match('/^address/', $line)) {
228
						$field = explode('/', $line);
229
						$host_name = trim($field[1]);
230
						$ip_addr   = trim($field[2]);
2380 tom.houday 231
						if (strcasecmp($add_host, $host_name) === 0) {
2316 tom.houday 232
							$insert = false;
233
							break;
1959 richard 234
						}
2380 tom.houday 235
						if (strcmp($add_ip, $ip_addr) === 0) {
2316 tom.houday 236
							$insert = false;
237
							break;
1959 richard 238
						}
841 richard 239
					}
240
				}
2316 tom.houday 241
				if ($insert) {
2380 tom.houday 242
					$line1 = 'address=/'.$add_host.'/'.$add_ip."\n";
243
					$explode_ip = explode('.', $add_ip);
2316 tom.houday 244
					$reverse_ip = implode('.', array_reverse($explode_ip));
2380 tom.houday 245
					$line2 = 'ptr-record='.$reverse_ip.'.in-addr.arpa,'.$add_host."\n";
2316 tom.houday 246
					$pointeur=fopen(DNS_LOCAL_FILE, 'a');
247
					fwrite($pointeur, $line1);
248
					fwrite($pointeur, $line2);
249
					fclose($pointeur);
250
					exec('sudo /usr/bin/systemctl restart dnsmasq');
251
					exec('sudo /usr/bin/systemctl restart dnsmasq-blacklist');
252
					exec('sudo /usr/bin/systemctl restart dnsmasq-whitelist');
1959 richard 253
				}
841 richard 254
			}
2380 tom.houday 255
		}
2316 tom.houday 256
		break;
257
	case 'del_host':
258
		foreach ($_POST as $key => $value) {
259
			if ($value == 'on') {
2380 tom.houday 260
				exec('/bin/sed -i '.escapeshellarg("\\@^address=/$key/@d;\\@^ptr-record=.*,$key\$@d").' '.DNS_LOCAL_FILE); 
2316 tom.houday 261
				exec('sudo /usr/bin/systemctl restart dnsmasq');
262
				exec('sudo /usr/bin/systemctl restart dnsmasq-blacklist');
263
				exec('sudo /usr/bin/systemctl restart dnsmasq-whitelist');
264
			}
841 richard 265
		}
2316 tom.houday 266
		break;
267
 
268
	case 'default_cert':	// Restore default certificate
269
		exec('sudo alcasar-importcert.sh -d');
270
		break;
271
 
272
	case 'import_cert':	// Import certificate
273
		if (isset($_FILES['key']) && isset($_FILES['crt']) && ($_FILES['key']['error'] == 0) && ($_FILES['crt']['error'] == 0)) {
274
			if ($_FILES['key']['size'] <= $maxsize && $_FILES['crt']['size'] <= $maxsize) {
275
				if (pathinfo($_FILES['key']['name'])['extension'] == 'key' && pathinfo($_FILES['crt']['name'])['extension'] == 'crt') {
276
					$dest = '/tmp/';
2380 tom.houday 277
					$scpath = '';
2316 tom.houday 278
					if (isset($_FILES['sc']) && (pathinfo($_FILES['sc']['name'])['extension'] == 'crt')) {
279
						$scpath = $dest.'server-chain.crt';
280
						move_uploaded_file($_FILES['sc']['tmp_name'], $scpath);
281
					}
2380 tom.houday 282
					$keypath = $dest.'alcasar.key';
283
					$crtpath = $dest.'alcasar.crt';
2316 tom.houday 284
					move_uploaded_file($_FILES['key']['tmp_name'], $keypath);
285
					move_uploaded_file($_FILES['crt']['tmp_name'], $crtpath);
286
					exec("sudo alcasar-importcert.sh -i $crtpath -k $keypath -c $scpath");
287
					if (file_exists($crtpath)) unlink($crtpath); 
288
					if (file_exists($keypath)) unlink($keypath); 
289
					if (file_exists($scpath))  unlink($scpath); 
290
				}
1959 richard 291
			}
292
		}
2316 tom.houday 293
		break;
2324 tom.houday 294
 
295
	case 'https_login':	// Set HTTPS login status
296
		if ($_POST['https_login'] === 'on') {
297
			exec('sudo /usr/local/bin/alcasar-https.sh --on');
298
		} else {
299
			exec('sudo /usr/local/bin/alcasar-https.sh --off');
300
		}
301
		header('Location: '.$_SERVER['PHP_SELF']);
302
		exit();
318 richard 303
}
304
 
2316 tom.houday 305
// Network changes
306
if ($choix === 'network_change') {
307
	$network_modification = false;
1733 richard 308
 
2316 tom.houday 309
	if (isset($_POST['dns1']) && (trim($_POST['dns1']) !== $conf['DNS1']) && preg_match($reg_ip, $_POST['dns1'])) {
310
		file_put_contents(CONF_FILE, str_replace('DNS1='.$conf['DNS1'], 'DNS1='.trim($_POST['dns1']), file_get_contents(CONF_FILE)));
311
		$network_modification = true;
318 richard 312
	}
2316 tom.houday 313
	if (isset($_POST['dns2']) && (trim($_POST['dns2']) !== $conf['DNS2']) && preg_match($reg_ip, $_POST['dns2'])) {
314
		file_put_contents(CONF_FILE, str_replace('DNS2='.$conf['DNS2'], 'DNS2='.trim($_POST['dns2']), file_get_contents(CONF_FILE)));
315
		$network_modification = true;
318 richard 316
	}
2316 tom.houday 317
	if (isset($_POST['ip_public']) && (trim($_POST['ip_public']) !== $conf['PUBLIC_IP']) && preg_match($reg_ip_cidr, $_POST['ip_public'])) {
318
		file_put_contents(CONF_FILE, str_replace('PUBLIC_IP='.$conf['PUBLIC_IP'], 'PUBLIC_IP='.trim($_POST['ip_public']), file_get_contents(CONF_FILE)));
319
		$network_modification = true;
320
	}
321
	if (isset($_POST['ip_gw']) && (trim($_POST['ip_gw']) !== $conf['GW']) && preg_match($reg_ip, $_POST['ip_gw'])) {
322
		file_put_contents(CONF_FILE, str_replace('GW='.$conf['GW'], 'GW='.trim($_POST['ip_gw']), file_get_contents(CONF_FILE)));
323
		$network_modification = true;
324
	}
325
	if (isset($_POST['ip_private']) && (trim($_POST['ip_private']) !== $conf['PRIVATE_IP']) && preg_match($reg_ip_cidr, $_POST['ip_private'])) {
326
		file_put_contents(CONF_FILE, str_replace('PRIVATE_IP='.$conf['PRIVATE_IP'], 'PRIVATE_IP='.trim($_POST['ip_private']), file_get_contents(CONF_FILE)));
327
		$network_modification = true;
328
	}
329
 
330
	if ($network_modification) {
331
		exec('sudo /usr/local/bin/alcasar-conf.sh -apply');
332
	}
333
 
334
	// Read CONF_FILE updated
335
	$file_conf = fopen(CONF_FILE, 'r');
336
	if (!$file_conf) {
337
		exit('Error opening the file '.CONF_FILE);
338
	}
339
	while (!feof($file_conf)) {
340
		$buffer = fgets($file_conf, 4096);
341
		if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
2450 tom.houday 342
			$tmp = explode('=', $buffer, 2);
2316 tom.houday 343
			$conf[trim($tmp[0])] = trim($tmp[1]);
344
		}
345
	}
346
	fclose($file_conf);
318 richard 347
}
2316 tom.houday 348
 
349
// Let's Encrypt actions
350
if ($choix === 'le_issueCert') {
351
	// TODO: check ndd & mail format
352
 
353
	$email      = $_POST['email'];
354
	$domainName = $_POST['domainname'];
355
 
356
	exec('sudo /usr/local/bin/alcasar-letsencrypt.sh --issue --email '.escapeshellarg($email).' --domain '.escapeshellarg($domainName), $output, $exitCode);
1822 raphael.pi 357
 
2316 tom.houday 358
	$cmdResponse = implode("<br>\n", $output);
1822 raphael.pi 359
}
2316 tom.houday 360
if ($choix === 'le_renewCert') {
361
	if ((isset($_POST['recheck'])) && ((!empty($_POST['recheck'])) || (!empty($_POST['recheck_force'])))) {
362
		$forceOpt = (!empty($_POST['recheck_force'])) ? ' --force' : '';
318 richard 363
 
2316 tom.houday 364
		exec('sudo /usr/local/bin/alcasar-letsencrypt.sh --renew' . $forceOpt, $output, $exitCode);
1822 raphael.pi 365
 
2316 tom.houday 366
		$cmdResponse = implode("<br>\n", $output);
367
	} else if ((isset($_POST['cancel'])) && (!empty($_POST['cancel']))) {
368
		file_put_contents(LETS_ENCRYPT_FILE, preg_replace('/challenge=.*/','challenge=', file_get_contents(LETS_ENCRYPT_FILE)));
369
		file_put_contents(LETS_ENCRYPT_FILE, preg_replace('/domainRequest=.*/','domainRequest=', file_get_contents(LETS_ENCRYPT_FILE)));
370
	}
1822 raphael.pi 371
}
372
 
373
 
2316 tom.houday 374
// Read Let's Encrypt configuration file
375
$file_conf_LE = fopen(LETS_ENCRYPT_FILE, 'r');
376
if (!$file_conf_LE) {
377
	exit('Error opening the file '.LETS_ENCRYPT_FILE);
2299 tom.houday 378
}
2316 tom.houday 379
while (!feof($file_conf_LE)) {
380
	$buffer = fgets($file_conf_LE, 4096);
2299 tom.houday 381
	if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
2450 tom.houday 382
		$tmp = explode('=', $buffer, 2);
2316 tom.houday 383
		$LE_conf[trim($tmp[0])] = trim($tmp[1]);
1822 raphael.pi 384
	}
385
}
2316 tom.houday 386
fclose($file_conf_LE);
387
 
388
 
389
// Fonction de test de connectivité internet
390
function internetTest() {
391
	$host = 'www.google.fr'; # Google Test
392
	$port = '80';
393
 
394
	if (! $sock = @fsockopen($host, $port, $num, $error, 5)) {
395
		return false;
396
	} else {
397
		fclose($sock);
398
		return true;
399
	}
400
}
401
 
402
$internet_connected = InternetTest();
403
if ($internet_connected) {
2404 tom.houday 404
	$ch = curl_init('https://api.ipify.org/');
405
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
406
	$internet_publicIP = curl_exec($ch);
407
	curl_close($ch);
2316 tom.houday 408
} else {
409
	$internet_publicIP = '-.-.-.-';
410
}
411
 
412
 
413
// Network interfaces
414
$interfacesIgnored = ['lo', 'tun[0-9]*', $conf['EXTIF'], $conf['INTIF']];
415
exec("ip -o link show | awk -F': ' '{print $2}' | sed '/^" . implode('\\|', $interfacesIgnored) . "$/d'", $interfacesAvailable);
416
 
417
// TODO: Pending the next version
418
$externalNetworks = [
419
	(object) [
420
		'interface' => $conf['EXTIF'],
421
		'ip'        => $conf['PUBLIC_IP'],
422
		'gateway'   => $conf['GW']
423
	]
424
];
425
$internalNetworks = [
426
	(object) [
427
		'interface' => $conf['INTIF'],
428
		'ip'        => $conf['PRIVATE_IP']
429
	]
430
];
431
 
1740 richard 432
?>
433
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2316 tom.houday 434
<html>
318 richard 435
<head>
2316 tom.houday 436
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
437
	<title><?= $l_network_title ?></title>
438
	<link rel="stylesheet" href="/css/style.css" type="text/css">
439
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
440
	<script src="/js/jquery.min.js"></script>
441
	<script src="/js/jquery.connections.js"></script>
442
	<script type="text/javascript">
443
	function MAC_Control(formulaire){
444
		// MAC control (upper case and '-' separator)
445
		var regex_mac = /^([0-9a-fA-F]{2}(-|:)){5}[0-9a-fA-F]{2}$/;
446
		if (regex_mac.test(document.forms[formulaire].add_mac.value)){
447
			document.forms[formulaire].add_mac.value = document.forms[formulaire].add_mac.value.toUpperCase().replace(/:/g, '-');
448
			return true;
449
		} else {
450
			alert('Invalid MAC address');
451
			return false;
452
		}
1578 richard 453
	}
2316 tom.houday 454
	</script>
455
	<style>
456
	.network-configurator {
457
		width: 100%;
458
	}
459
	.network-configurator > * {
460
		display: inline-block;
461
		vertical-align: top;
462
		text-align: center;
463
	}
464
	.network-configurator > .internet, .network-configurator > .alcasar {
465
		width: 20%;
466
	}
467
	.network-configurator > .externals, .network-configurator > .internals {
468
		width: 30%;
469
	}
470
	.network-configurator .actions {
471
		position: absolute;
472
		background-color: #ddd;
473
		padding: 0 2px;
474
	}
475
	.network-configurator .actions a {
476
		text-decoration: none;
477
	}
478
	.network-configurator .actions a:hover {
479
		font-weight: bold;
480
	}
481
	.network-configurator > .alcasar .actions-externals {
482
		bottom: 0;
483
		left: 0;
484
		border-radius: 0 5px;
485
	}
486
	.network-configurator > .alcasar .actions-internals {
487
		bottom: 0;
488
		right: 0;
489
		border-radius: 5px 0;
490
	}
491
	.network-configurator .actions-network {
492
		top: 0;
493
		right: 0;
494
		border-radius: 0 5px;
495
	}
496
	.network-configurator .network-box {
497
		display: inline-block;
498
		min-height: 100px;
499
		margin: 5px;
500
		padding: 3px;
501
		text-align: left;
502
		background-color: #f7f3ef;
503
		position: relative;
504
		border-radius: 5px;
505
		border: 2px solid grey;
506
	}
507
	.network-configurator .network-connector {
508
		display: inline-block;
509
		position: absolute;
510
		top: 50%;
511
		margin-top: -5px;
512
		margin-left: -5px;
513
		width: 10px;
514
		height: 10px;
515
		border-radius: 5px;
516
		background-color: black;
517
	}
518
	.network-configurator .network-connector[data-connector-direction="left"] {
519
		border-radius: 5px 0px 0px 5px;
520
	}
521
	.network-configurator .network-connector[data-connector-direction="right"] {
522
		border-radius: 0px 5px 5px 0px;
523
	}
524
	.network-configurator div[data-network-type] {
525
		position: relative;
526
	}
527
	</style>
528
	<script>
529
	$(document).ready(function () {
530
		const interfacesAvailable = <?= ((!empty($interfacesAvailable)) ? "['".implode("', '", $interfacesAvailable)."']" : '[]') ?>;
531
 
532
		const wireStyles = {
533
			available: { border: '5px double green' }
2325 tom.houday 534
		};
2316 tom.houday 535
 
536
		// Add external network
537
		$('.network-configurator .add-external-network').click(function (event) {
538
			event.preventDefault();
539
			let options = '';
540
			if (interfacesAvailable.length === 0) {
541
				options = '<option value=""></option>';
542
			} else {
543
				for (let i = 0; i < interfacesAvailable.length; i++) {
544
					options += '<option value="' + interfacesAvailable[i] + '">' + interfacesAvailable[i] + '</option>';
545
				}
546
			}
547
			$('.network-configurator .externals').append(' \
548
				<div data-network-type="external"> \
549
					<div class="network-connector" data-connector-network="internet" data-connector-direction="left"></div> \
550
					<div class="network-box"> \
551
						<div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> \
552
						<label for="ext_interface_X"><?= 'Interface' ?></label> <select name="interface" id="ext_interface_X">' + options + '</select><br> \
553
						<label for="ext_ip_X"><?= $l_ip_address ?></label> <input style="width:150px" type="text" name="ip_public" id="ext_ip_X" value="" /><br> \
554
						<label for="ext_gateway_X"><?= $l_ip_router ?></label> <input style="width:120px" type="text" name="ip_gw" id="ext_gateway_X" value="" /> \
555
					</div> \
556
					<div class="network-connector" data-connector-network="external" data-connector-direction="right"></div> \
557
				</div>');
558
			addWire($('div[data-network-type="external"]:last'));
559
		});
560
 
561
		// Add internal network
562
		$('.network-configurator .add-internal-network').click(function (event) {
563
			event.preventDefault();
564
			$('.network-configurator .internals').append(' \
565
					<div data-network-type="internal"> \
566
						<div class="network-connector" data-connector-network="internal" data-connector-direction="left"></div> \
567
						<div class="network-box"> \
568
							<div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> \
569
							<label for="int_interface_X"><?= 'Interface' ?></label> <select name="interface" id="int_interface_X" disabled><option value=""></option></select><br> \
570
							<label for="int_ip_X"><?= $l_ip_address ?></label> <input style="width:150px" type="text" name="ip_private" id="int_ip_X" value="" /><br> \
571
						</div> \
572
					</div>');
573
			addWire($('div[data-network-type="internal"]:last'));
574
		});
575
 
576
		// Remove network
577
		$('.network-configurator').on('click', '.remove-network', function (event) {
578
			event.preventDefault();
579
			$(this).parent().parent().parent().fadeOut(200, function() {
580
				const networkType = $(this).data('networkType');
581
				$(this).remove();
582
 
583
				// Update wires
584
				if (networkType === 'external') {
585
					$('div[data-network-type="internet"]>div.network-connector[data-connector-network="internet"]').connections('update');
586
					$('div[data-network-type="alcasar"]>div.network-connector[data-connector-network="external"]').connections('update');
587
				} else if (networkType === 'internal') {
588
					$('div[data-network-type="alcasar"]>div.network-connector[data-connector-network="internal"]').connections('update');
589
				}
590
			});
591
		});
592
 
593
		const addWire = function (network) {
594
			const networkType = network.data('networkType');
595
			if (networkType === 'external') {
596
				$().connections({ from: 'div[data-network-type="internet"]>div.network-connector[data-connector-network="internet"]', to: 'div[data-network-type="external"]>div.network-connector[data-connector-network="internet"]:last', css: wireStyles.available, within: 'div[data-network-type="external"]:last' });
597
				$().connections({ from: 'div[data-network-type="alcasar"]>div.network-connector[data-connector-network="external"]', to: 'div[data-network-type="external"]>div.network-connector[data-connector-network="external"]:last', css: wireStyles.available, within: 'div[data-network-type="external"]:last' });
598
			} else if (networkType === 'internal') {
599
				$().connections({ from: 'div[data-network-type="alcasar"]>div.network-connector[data-connector-network="internal"]', to: 'div[data-network-type="internal"]>div.network-connector[data-connector-network="internal"]:last', css: wireStyles.available, within: 'div[data-network-type="internal"]:last' });
600
			}
2325 tom.houday 601
		};
2316 tom.houday 602
 
2325 tom.houday 603
		window.addEventListener('resize', function () {
604
			$('div.network-connector[data-connector-network]').connections('update');
605
		});
606
 
2316 tom.houday 607
		// Add wires to existing networks
608
		$('div[data-network-type="external"]').add('div[data-network-type="internal"]').each(function (index, element) {
609
			addWire($(this));
2325 tom.houday 610
		});
2316 tom.houday 611
	});
612
	</script>
318 richard 613
</head>
614
<body>
2316 tom.houday 615
	<div class="panel">
616
		<div class="panel-header"><?= $l_network_title ?></div>
617
		<div class="panel-body">
618
			<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="post">
619
				<div class="network-configurator">
620
					<div class="internet">
621
						<div data-network-type="internet">
622
							<div class="network-box">
623
								<?= $l_internet_legend ?> <img src="/images/state_<?= (($internet_connected) ? 'ok' : 'error') ?>.gif"><br>
624
								<?= $l_ip_public ?> : <?= $internet_publicIP ?><br>
625
								<label for="dns1"><?= $l_ip_dns1 ?></label> : <input style="width:120px" type="text" id="dns1" name="dns1" value="<?= $conf['DNS1'] ?>" /><br>
626
								<label for="dns2"><?= $l_ip_dns2 ?></label> : <input style="width:120px" type="text" id="dns2" name="dns2" value="<?= $conf['DNS2'] ?>" />
627
							</div>
628
							<div class="network-connector" data-connector-network="internet" data-connector-direction="right"></div>
629
						</div>
630
					</div><div class="externals">
631
						<?php foreach ($externalNetworks as $index => $network): ?>
632
							<div data-network-type="external">
633
								<div class="network-connector" data-connector-network="internet" data-connector-direction="left"></div>
634
								<div class="network-box">
635
									<!-- <div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> -->
636
									<label for="ext_interface_<?= $index ?>"><?= 'Interface' ?></label> <select name="ext_interface[<?= $index ?>]" id="ext_interface_<?= $index ?>" disabled><option value="<?= $network->interface ?>"><?= $network->interface ?></option></select><br>
637
									<label for="ext_ip_<?= $index ?>"><?= $l_ip_address ?></label> <input style="width:150px" type="text" name="ip_public" id="ext_ip_<?= $index ?>" value="<?= $network->ip ?>" /><br>
638
									<label for="ext_gateway_<?= $index ?>"><?= $l_ip_router ?></label> <input style="width:120px" type="text" name="ip_gw" id="ext_gateway_<?= $index ?>" value="<?= $network->gateway ?>" />
639
								</div>
640
								<div class="network-connector" data-connector-network="external" data-connector-direction="right"></div>
641
							</div>
642
						<? endforeach; ?>
643
					</div><div class="alcasar">
644
						<div data-network-type="alcasar">
645
							<div class="network-connector" data-connector-network="external" data-connector-direction="left"></div>
646
							<div class="network-box">
647
								<!-- <div class="actions actions-externals">
648
									<div><a href="#" class="add-external-network" title="Ajouter un réseau externe">+</a></div>
649
								</div> -->
650
								<div class="alcasar-logo"><img src="/images/logo-alcasar.png" style="width: 100px;height: 100px;"></div>
651
								<!-- <div class="actions actions-internals">
652
									<div><a href="#" class="add-internal-network" title="Ajouter un réseau interne">+</a></div>
653
									<div><a href="#" class="add-internal-wifi-network">++</a></div>
654
								</div> -->
655
							</div>
656
							<div class="network-connector" data-connector-network="internal" data-connector-direction="right"></div>
657
						</div>
658
					</div><div class="internals">
659
						<?php foreach ($internalNetworks as $network): ?>
660
							<div data-network-type="internal">
661
								<div class="network-connector" data-connector-network="internal" data-connector-direction="left"></div>
662
								<div class="network-box">
663
									<!-- <div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> -->
664
									<label for="int_interface_<?= $index ?>"><?= 'Interface' ?></label> <select name="int_interface[<?= $index ?>]" id="int_interface_<?= $index ?>" disabled><option value="<?= $network->interface ?>"><?= $network->interface ?></option></select><br>
665
									<label for="int_ip_<?= $index ?>"><?= $l_ip_address ?></label> <input style="width:150px" type="text" name="ip_private" id="int_ip_<?= $index ?>" value="<?= $network->ip ?>" /><br>
666
								</div>
667
							</div>
668
						<? endforeach; ?>
669
					</div>
670
				</div>
671
				<hr>
672
				<div style="text-align: center; margin: 5px">
673
					<input type="hidden" name="choix" value="network_change">
674
					<input type="submit" value="<?= $l_apply ?>">
675
				</div>
676
			</form>
677
		</div>
678
	</div>
679
	<br>
680
 
2304 tom.houday 681
<table width="100%" cellspacing="0" cellpadding="0" border="0">
2316 tom.houday 682
	<tr><th><?= $l_dhcp_title?></th></tr>
318 richard 683
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
684
</table>
2304 tom.houday 685
<table width="100%" cellspacing="0" cellpadding="5" border="1">
2316 tom.houday 686
	<tr><td colspan="2" valign="middle" align="left">
687
	<center><h3><?= $l_dhcp_state ?> : <?= ${'l_DHCP_'.$conf['DHCP']} ?></h3></center>
688
	<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
2324 tom.houday 689
		<select name="choix">
2316 tom.houday 690
			<option value="DHCP_Off"<?= ((!strcmp($conf['DHCP'], 'off')) ? ' selected' : '') ?>><?= $l_DHCP_off ?></option>
691
			<option value="DHCP_On"<?= ((!strcmp($conf['DHCP'], 'on')) ? ' selected' : '') ?>><?= $l_DHCP_on ?></option>
692
		</select>
693
		<input type="submit" value="<?= $l_apply ?>">
694
		<br><?= $l_DHCP_off_explain ?>
695
	</form>
696
	</td></tr>
697
 
1822 raphael.pi 698
	<?php
2316 tom.houday 699
	if ($conf['DHCP'] === 'on') {
700
		require('network2.php');
701
	}
1822 raphael.pi 702
	?>
318 richard 703
</table>
2316 tom.houday 704
<br>
2013 raphael.pi 705
 
2304 tom.houday 706
<table width="100%" cellspacing="0" cellpadding="0" border="0">
2316 tom.houday 707
	<tr><th><?= $l_local_dns?></th></tr>
1959 richard 708
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
709
</table>
2304 tom.houday 710
<table width="100%" cellspacing="0" cellpadding="5" border="1">
2316 tom.houday 711
<tr>
712
	<td width="50%" align="center">
713
		<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
714
		<table cellspacing="2" cellpadding="3" border="1">
715
		<tr><th><?= $l_host_name ?></th><th><?= $l_ip_address ?></th><th><?= $l_del ?></th></tr>
716
		<?php
717
		// Read the "dns_local" file
718
		$line_exist = false;
719
		$tab = file(DNS_LOCAL_FILE);
720
		if ($tab) { // not empty
721
			foreach ($tab as $line) {
722
				if (preg_match ('/^address/', $line)) {
723
					$line_exist = true;
724
					$field = explode('/', $line);
725
					$host_name = $field[1];
726
					$ip_addr   = $field[2];
727
					echo "<tr><td>$host_name</td>";
728
					echo "<td>$ip_addr</td>";
729
					echo "<td><input type=\"checkbox\" name=\"$host_name\"></td>";
730
					echo "</tr>";
731
				}
1959 richard 732
			}
733
		}
2316 tom.houday 734
		if (!$line_exist) {
735
			echo '<tr><td colspan="3" style="text-align: center;font-style: italic;">'.$l_empty.'</td></tr>';
736
		}
737
		?>
738
		</table>
739
		<?php if ($line_exist): ?>
740
			<input type="hidden" name="choix" value="del_host">
741
			<input type="submit" value="<?= $l_apply ?>">
742
		<?php endif; ?>
743
		</form>
744
	</td>
745
	<td width="50%" valign="middle" align="center">
746
		<form name="new_host" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
747
		<table cellspacing="2" cellpadding="3" border="1">
748
		<tr>
749
			<th><?= $l_host_name ?></th><th><?= $l_ip_address ?></th><td></td>
750
		</tr>
751
		<tr>
752
			<td>Ex. : my_nas</td><td>Ex. : 192.168.182.10</td><td></td>
753
		</tr>
754
		<tr>
755
			<td><input type="text" name="add_host" size="17"></td>
756
			<td><input type="text" name="add_ip" size="10"><input type="hidden" name="choix" value="new_host"></td>
757
			<td><input type=submit class=button value="<?= $l_add_to_list ?>"></td>
758
		</tr>
759
		</table>
760
		</form>
761
	</td>
762
</tr>
1959 richard 763
</table>
2316 tom.houday 764
<br>
765
 
2304 tom.houday 766
<table width="100%" cellspacing="0" cellpadding="0" border="0">
2316 tom.houday 767
	<tr><th><?= $l_import_cert ?></th></tr>
1710 richard 768
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
769
</table>
2304 tom.houday 770
<table width="100%" cellspacing="0" cellpadding="5" border="1">
771
	<tr>
2324 tom.houday 772
		<td width="50%" valign="top">
773
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
774
				<input type="hidden" name="choix" value="https_login">
2326 tom.houday 775
				<span><?= $l_allow_unsecured_login ?></span><br>
2324 tom.houday 776
				<select name="https_login">
2326 tom.houday 777
					<option value="on"<?=  (($conf['HTTPS_LOGIN'] === 'on')  ? ' selected' : '') ?>><?= $l_no ?></option>
778
					<option value="off"<?= (($conf['HTTPS_LOGIN'] === 'off') ? ' selected' : '') ?>><?= $l_yes ?></option>
2324 tom.houday 779
				</select>
780
				<input type="submit" value="<?= $l_apply ?>"><br>
2326 tom.houday 781
				<span><?= $l_unsecured_login_warning ?></span>
2297 tom.houday 782
			</form>
2324 tom.houday 783
			<br>
784
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
785
				<input type="hidden" name="choix" value="default_cert">
786
				<input type="submit" value="<?= $l_default_cert ?>" <?= (!file_exists('/etc/pki/tls/certs/alcasar.crt.old') || !file_exists('/etc/pki/tls/private/alcasar.key.old')) ? ' disabled' : '' ?>>
787
			</form>
788
		</td>
789
		<td width="50%" valign="top">
2297 tom.houday 790
			<?php
791
			$certificateInfos = openssl_x509_parse(file_get_contents('/etc/pki/tls/certs/alcasar.crt'));
792
 
793
			$cert_expiration_date = date('d-m-Y H:i:s', $certificateInfos['validTo_time_t']);
794
			$domain               = $certificateInfos['subject']['CN'];
795
			$organization         = (isset($certificateInfos['subject']['O'])) ? $certificateInfos['subject']['O'] : '';
796
			$CAdomain             = $certificateInfos['issuer']['CN'];
797
			$CAorganization       = (isset($certificateInfos['issuer']['O'])) ? $certificateInfos['issuer']['O'] : '';
798
			?>
799
			<h3><?= $l_current_certificate ?></h3>
2326 tom.houday 800
			<?= $l_cert_expiration ?> <?= $cert_expiration_date ?><br>
801
			<?= $l_cert_commonname ?> <?= $domain ?><br>
802
			<?= $l_cert_organization ?> <?= $organization ?><br/>
2297 tom.houday 803
			<h4><?=  $l_validated ?></h4>
2326 tom.houday 804
			<?= $l_cert_commonname ?> <?= $CAdomain ?><br>
805
			<?= $l_cert_organization ?> <?= $CAorganization ?><br>
2324 tom.houday 806
		</td>
807
	</tr>
808
	<tr>
809
		<td width="50%" valign="top">
2326 tom.houday 810
			<h3><?= $l_upload_certificate ?></h3>
2324 tom.houday 811
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" enctype="multipart/form-data">
812
				<?= $l_private_key;?> <input type="file" name="key"><br>
813
				<?= $l_certificate;?> <input type="file" name="crt"><br>
814
				<?= $l_server_chain;?> <input type="file" name="sc"><br>
815
				<input type="hidden" name="choix" value="import_cert">
816
				<input type="submit" value="<?= $l_import ?>">
2297 tom.houday 817
			</form>
818
		</td>
2304 tom.houday 819
		<td width="50%" valign="top">
820
			<?php
821
			// Get step
822
			if (empty($LE_conf['domainRequest'])) {
823
				$step = 1;
824
			} else if (!empty($LE_conf['challenge'])) {
825
				$step = 2;
826
			} else if (($domain === $LE_conf['domainRequest']) && (empty($LE_conf['challenge']))) {
827
				$step = 3;
828
			} else {
829
				$step = 1;
830
			}
831
			?>
2326 tom.houday 832
			<h3><?= $l_le_integration ?></h3>
2324 tom.houday 833
			<?php if ($step === 1): ?>
2316 tom.houday 834
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
835
					<input type="hidden" name="choix" value="le_issueCert">
2326 tom.houday 836
					<?= $l_le_status ?> <?= $l_disabled ?><br>
837
					<?= $l_le_email ?> <input type="text" name="email" placeholder="adresse@email.com"<?= ((!empty($LE_conf['email'])) ? ' value="'.$LE_conf['email'].'"' : '') ?>><br>
838
					<?= $l_le_domain_name ?> <input type="text" name="domainname" placeholder="alcasar.domain.tld" required><br>
839
					<input type="submit" name="issue" value="<?= $l_send ?>"><br>
2304 tom.houday 840
				</form>
841
			<?php elseif ($step === 2): ?>
2316 tom.houday 842
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
843
					<input type="hidden" name="choix" value="le_renewCert">
2326 tom.houday 844
					<?= $l_le_status ?> <?= $l_pending_validation ?><br>
845
					<?= $l_le_domain_name ?> <?= $LE_conf['domainRequest'] ?><br>
846
					<?= $l_le_ask_on ?> <?= date('d-m-Y H:i:s', $LE_conf['dateIssueRequest']) ?><br>
847
					<?= $l_le_dns_entry_txt ?> "<?= '_acme-challenge.'.$LE_conf['domainRequest'] ?>"<br>
848
					<?= $l_le_challenge ?> "<?= $LE_conf['challenge'] ?>"<br>
849
					<input type="submit" name="recheck" value="<?= $l_recheck ?>"> <input type="submit" name="cancel" value="<?= $l_cancel ?>"><br>
2304 tom.houday 850
				</form>
851
			<?php elseif ($step === 3): ?>
2316 tom.houday 852
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
853
					<input type="hidden" name="choix" value="le_renewCert">
2326 tom.houday 854
					<?= $l_le_status ?> <?= $l_enabled ?><br>
855
					<?= $l_le_domain_name ?> <?= $LE_conf['domainRequest'] ?><br>
856
					<?= $l_le_api ?>  <?= $LE_conf['dnsapi'] ?><br>
857
					<?= $l_le_next_renewal ?> <?= date('d-m-Y', $LE_conf['dateNextRenewal']) ?><br>
2304 tom.houday 858
					<?php if ($LE_conf['dateNextRenewal'] <= date('U')): ?>
2326 tom.houday 859
						<input type="submit" name="recheck" value="<?= $l_renew ?>"><br>
2304 tom.houday 860
					<?php else: ?>
2326 tom.houday 861
						<input type="submit" name="recheck_force" value="<?= $l_renew_force ?>"><br>
2304 tom.houday 862
					<?php endif; ?>
863
				</form>
864
			<?php endif; ?>
865
			<?php if (isset($cmdResponse)): ?>
866
				<p><?= $cmdResponse ?></p>
867
			<?php endif; ?>
868
		</td>
1710 richard 869
	</tr>
870
</table>
318 richard 871
</body>
872
</html>