Subversion Repositories ALCASAR

Rev

Rev 2558 | Rev 2609 | 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 2559 2018-06-10 12:56:39Z rexy $
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');
2558 rexy 12
define('DNS_LOCAL_FILE', '/etc/hosts');
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;
2559 rexy 212
				exec("/bin/sed -i ".escapeshellarg("/^$key/d")." $ether_file");
213
				exec("/bin/sed -i ".escapeshellarg("/^$key/d")." $ether_file_info");
2316 tom.houday 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;
2559 rexy 226
				foreach ($tab as $line) { // verify that host or IP address doesn't exist
227
					if (preg_match('/^\d+/', $line)) {
228
						$field = preg_split("/\s+/",$line);
229
						$ip_addr = $field[0];
230
						$host_name = trim($field[1]);
231
						if (strcmp($add_ip, $ip_addr) === 0) {
232
							$insert = false;
233
							break;
234
						}
235
						if (strcasecmp($add_host, $host_name) === 0) {
236
							$insert = false;
237
							break;
238
						}
841 richard 239
					}
2559 rexy 240
				}
2316 tom.houday 241
				if ($insert) {
2559 rexy 242
					exec("sudo /usr/local/bin/alcasar-dns-local.sh -add $add_ip $add_host");
1959 richard 243
				}
841 richard 244
			}
2380 tom.houday 245
		}
2316 tom.houday 246
		break;
247
	case 'del_host':
248
		foreach ($_POST as $key => $value) {
249
			if ($value == 'on') {
2559 rexy 250
				$del_host = explode ("|", $key);
251
				$del_ip = str_replace("_",".",$del_host[0]);
252
				exec("sudo /usr/local/bin/alcasar-dns-local.sh --del $del_ip $del_host[1]");
2316 tom.houday 253
			}
841 richard 254
		}
2316 tom.houday 255
		break;
256
 
257
	case 'default_cert':	// Restore default certificate
258
		exec('sudo alcasar-importcert.sh -d');
259
		break;
260
 
261
	case 'import_cert':	// Import certificate
2479 tom.houday 262
		$maxsize = 100000;
2316 tom.houday 263
		if (isset($_FILES['key']) && isset($_FILES['crt']) && ($_FILES['key']['error'] == 0) && ($_FILES['crt']['error'] == 0)) {
264
			if ($_FILES['key']['size'] <= $maxsize && $_FILES['crt']['size'] <= $maxsize) {
2479 tom.houday 265
				if (pathinfo($_FILES['key']['name'])['extension'] == 'key' && ((pathinfo($_FILES['crt']['name'])['extension'] == 'crt') || (pathinfo($_FILES['crt']['name'])['extension'] == 'cer'))) {
2316 tom.houday 266
					$dest = '/tmp/';
2380 tom.houday 267
					$scpath = '';
2479 tom.houday 268
					if (isset($_FILES['sc']) && ((pathinfo($_FILES['sc']['name'])['extension'] == 'crt') || (pathinfo($_FILES['sc']['name'])['extension'] == 'cer'))) {
2316 tom.houday 269
						$scpath = $dest.'server-chain.crt';
270
						move_uploaded_file($_FILES['sc']['tmp_name'], $scpath);
271
					}
2380 tom.houday 272
					$keypath = $dest.'alcasar.key';
273
					$crtpath = $dest.'alcasar.crt';
2316 tom.houday 274
					move_uploaded_file($_FILES['key']['tmp_name'], $keypath);
275
					move_uploaded_file($_FILES['crt']['tmp_name'], $crtpath);
276
					exec("sudo alcasar-importcert.sh -i $crtpath -k $keypath -c $scpath");
277
					if (file_exists($crtpath)) unlink($crtpath);
278
					if (file_exists($keypath)) unlink($keypath);
279
					if (file_exists($scpath))  unlink($scpath);
280
				}
1959 richard 281
			}
282
		}
2316 tom.houday 283
		break;
2324 tom.houday 284
 
285
	case 'https_login':	// Set HTTPS login status
286
		if ($_POST['https_login'] === 'on') {
287
			exec('sudo /usr/local/bin/alcasar-https.sh --on');
288
		} else {
289
			exec('sudo /usr/local/bin/alcasar-https.sh --off');
290
		}
291
		header('Location: '.$_SERVER['PHP_SELF']);
292
		exit();
318 richard 293
}
294
 
2316 tom.houday 295
// Network changes
296
if ($choix === 'network_change') {
297
	$network_modification = false;
1733 richard 298
 
2316 tom.houday 299
	if (isset($_POST['dns1']) && (trim($_POST['dns1']) !== $conf['DNS1']) && preg_match($reg_ip, $_POST['dns1'])) {
300
		file_put_contents(CONF_FILE, str_replace('DNS1='.$conf['DNS1'], 'DNS1='.trim($_POST['dns1']), file_get_contents(CONF_FILE)));
301
		$network_modification = true;
318 richard 302
	}
2316 tom.houday 303
	if (isset($_POST['dns2']) && (trim($_POST['dns2']) !== $conf['DNS2']) && preg_match($reg_ip, $_POST['dns2'])) {
304
		file_put_contents(CONF_FILE, str_replace('DNS2='.$conf['DNS2'], 'DNS2='.trim($_POST['dns2']), file_get_contents(CONF_FILE)));
305
		$network_modification = true;
318 richard 306
	}
2316 tom.houday 307
	if (isset($_POST['ip_public']) && (trim($_POST['ip_public']) !== $conf['PUBLIC_IP']) && preg_match($reg_ip_cidr, $_POST['ip_public'])) {
308
		file_put_contents(CONF_FILE, str_replace('PUBLIC_IP='.$conf['PUBLIC_IP'], 'PUBLIC_IP='.trim($_POST['ip_public']), file_get_contents(CONF_FILE)));
309
		$network_modification = true;
310
	}
311
	if (isset($_POST['ip_gw']) && (trim($_POST['ip_gw']) !== $conf['GW']) && preg_match($reg_ip, $_POST['ip_gw'])) {
312
		file_put_contents(CONF_FILE, str_replace('GW='.$conf['GW'], 'GW='.trim($_POST['ip_gw']), file_get_contents(CONF_FILE)));
313
		$network_modification = true;
314
	}
315
	if (isset($_POST['ip_private']) && (trim($_POST['ip_private']) !== $conf['PRIVATE_IP']) && preg_match($reg_ip_cidr, $_POST['ip_private'])) {
316
		file_put_contents(CONF_FILE, str_replace('PRIVATE_IP='.$conf['PRIVATE_IP'], 'PRIVATE_IP='.trim($_POST['ip_private']), file_get_contents(CONF_FILE)));
317
		$network_modification = true;
318
	}
319
 
320
	if ($network_modification) {
321
		exec('sudo /usr/local/bin/alcasar-conf.sh -apply');
322
	}
323
 
324
	// Read CONF_FILE updated
325
	$file_conf = fopen(CONF_FILE, 'r');
326
	if (!$file_conf) {
327
		exit('Error opening the file '.CONF_FILE);
328
	}
329
	while (!feof($file_conf)) {
330
		$buffer = fgets($file_conf, 4096);
331
		if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
2450 tom.houday 332
			$tmp = explode('=', $buffer, 2);
2316 tom.houday 333
			$conf[trim($tmp[0])] = trim($tmp[1]);
334
		}
335
	}
336
	fclose($file_conf);
318 richard 337
}
2316 tom.houday 338
 
339
// Let's Encrypt actions
340
if ($choix === 'le_issueCert') {
341
	// TODO: check ndd & mail format
342
 
343
	$email      = $_POST['email'];
344
	$domainName = $_POST['domainname'];
345
 
346
	exec('sudo /usr/local/bin/alcasar-letsencrypt.sh --issue --email '.escapeshellarg($email).' --domain '.escapeshellarg($domainName), $output, $exitCode);
1822 raphael.pi 347
 
2316 tom.houday 348
	$cmdResponse = implode("<br>\n", $output);
1822 raphael.pi 349
}
2316 tom.houday 350
if ($choix === 'le_renewCert') {
351
	if ((isset($_POST['recheck'])) && ((!empty($_POST['recheck'])) || (!empty($_POST['recheck_force'])))) {
352
		$forceOpt = (!empty($_POST['recheck_force'])) ? ' --force' : '';
318 richard 353
 
2316 tom.houday 354
		exec('sudo /usr/local/bin/alcasar-letsencrypt.sh --renew' . $forceOpt, $output, $exitCode);
1822 raphael.pi 355
 
2316 tom.houday 356
		$cmdResponse = implode("<br>\n", $output);
357
	} else if ((isset($_POST['cancel'])) && (!empty($_POST['cancel']))) {
358
		file_put_contents(LETS_ENCRYPT_FILE, preg_replace('/challenge=.*/','challenge=', file_get_contents(LETS_ENCRYPT_FILE)));
359
		file_put_contents(LETS_ENCRYPT_FILE, preg_replace('/domainRequest=.*/','domainRequest=', file_get_contents(LETS_ENCRYPT_FILE)));
360
	}
1822 raphael.pi 361
}
362
 
363
 
2316 tom.houday 364
// Read Let's Encrypt configuration file
365
$file_conf_LE = fopen(LETS_ENCRYPT_FILE, 'r');
366
if (!$file_conf_LE) {
367
	exit('Error opening the file '.LETS_ENCRYPT_FILE);
2299 tom.houday 368
}
2316 tom.houday 369
while (!feof($file_conf_LE)) {
370
	$buffer = fgets($file_conf_LE, 4096);
2299 tom.houday 371
	if ((strpos($buffer, '=') !== false) && (substr($buffer, 0, 1) !== '#')) {
2450 tom.houday 372
		$tmp = explode('=', $buffer, 2);
2316 tom.houday 373
		$LE_conf[trim($tmp[0])] = trim($tmp[1]);
1822 raphael.pi 374
	}
375
}
2316 tom.houday 376
fclose($file_conf_LE);
377
 
378
 
379
// Fonction de test de connectivité internet
380
function internetTest() {
381
	$host = 'www.google.fr'; # Google Test
382
	$port = '80';
383
 
384
	if (! $sock = @fsockopen($host, $port, $num, $error, 5)) {
385
		return false;
386
	} else {
387
		fclose($sock);
388
		return true;
389
	}
390
}
391
 
392
$internet_connected = InternetTest();
393
if ($internet_connected) {
2404 tom.houday 394
	$ch = curl_init('https://api.ipify.org/');
395
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
396
	$internet_publicIP = curl_exec($ch);
397
	curl_close($ch);
2316 tom.houday 398
} else {
399
	$internet_publicIP = '-.-.-.-';
400
}
401
 
402
 
403
// Network interfaces
404
$interfacesIgnored = ['lo', 'tun[0-9]*', $conf['EXTIF'], $conf['INTIF']];
405
exec("ip -o link show | awk -F': ' '{print $2}' | sed '/^" . implode('\\|', $interfacesIgnored) . "$/d'", $interfacesAvailable);
406
 
407
// TODO: Pending the next version
408
$externalNetworks = [
409
	(object) [
410
		'interface' => $conf['EXTIF'],
411
		'ip'        => $conf['PUBLIC_IP'],
412
		'gateway'   => $conf['GW']
413
	]
414
];
415
$internalNetworks = [
416
	(object) [
417
		'interface' => $conf['INTIF'],
418
		'ip'        => $conf['PRIVATE_IP']
419
	]
420
];
421
 
1740 richard 422
?>
423
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2316 tom.houday 424
<html>
318 richard 425
<head>
2316 tom.houday 426
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
427
	<title><?= $l_network_title ?></title>
428
	<link rel="stylesheet" href="/css/style.css" type="text/css">
429
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
430
	<script src="/js/jquery.min.js"></script>
431
	<script src="/js/jquery.connections.js"></script>
432
	<script type="text/javascript">
433
	function MAC_Control(formulaire){
434
		// MAC control (upper case and '-' separator)
435
		var regex_mac = /^([0-9a-fA-F]{2}(-|:)){5}[0-9a-fA-F]{2}$/;
436
		if (regex_mac.test(document.forms[formulaire].add_mac.value)){
437
			document.forms[formulaire].add_mac.value = document.forms[formulaire].add_mac.value.toUpperCase().replace(/:/g, '-');
438
			return true;
439
		} else {
440
			alert('Invalid MAC address');
441
			return false;
442
		}
1578 richard 443
	}
2316 tom.houday 444
	</script>
445
	<style>
446
	.network-configurator {
447
		width: 100%;
448
	}
449
	.network-configurator > * {
450
		display: inline-block;
451
		vertical-align: top;
452
		text-align: center;
453
	}
454
	.network-configurator > .internet, .network-configurator > .alcasar {
455
		width: 20%;
456
	}
457
	.network-configurator > .externals, .network-configurator > .internals {
458
		width: 30%;
459
	}
460
	.network-configurator .actions {
461
		position: absolute;
462
		background-color: #ddd;
463
		padding: 0 2px;
464
	}
465
	.network-configurator .actions a {
466
		text-decoration: none;
467
	}
468
	.network-configurator .actions a:hover {
469
		font-weight: bold;
470
	}
471
	.network-configurator > .alcasar .actions-externals {
472
		bottom: 0;
473
		left: 0;
474
		border-radius: 0 5px;
475
	}
476
	.network-configurator > .alcasar .actions-internals {
477
		bottom: 0;
478
		right: 0;
479
		border-radius: 5px 0;
480
	}
481
	.network-configurator .actions-network {
482
		top: 0;
483
		right: 0;
484
		border-radius: 0 5px;
485
	}
486
	.network-configurator .network-box {
487
		display: inline-block;
488
		min-height: 100px;
489
		margin: 5px;
490
		padding: 3px;
491
		text-align: left;
492
		background-color: #f7f3ef;
493
		position: relative;
494
		border-radius: 5px;
495
		border: 2px solid grey;
496
	}
497
	.network-configurator .network-connector {
498
		display: inline-block;
499
		position: absolute;
500
		top: 50%;
501
		margin-top: -5px;
502
		margin-left: -5px;
503
		width: 10px;
504
		height: 10px;
505
		border-radius: 5px;
506
		background-color: black;
507
	}
508
	.network-configurator .network-connector[data-connector-direction="left"] {
509
		border-radius: 5px 0px 0px 5px;
510
	}
511
	.network-configurator .network-connector[data-connector-direction="right"] {
512
		border-radius: 0px 5px 5px 0px;
513
	}
514
	.network-configurator div[data-network-type] {
515
		position: relative;
516
	}
517
	</style>
518
	<script>
519
	$(document).ready(function () {
520
		const interfacesAvailable = <?= ((!empty($interfacesAvailable)) ? "['".implode("', '", $interfacesAvailable)."']" : '[]') ?>;
521
 
522
		const wireStyles = {
523
			available: { border: '5px double green' }
2325 tom.houday 524
		};
2316 tom.houday 525
 
526
		// Add external network
527
		$('.network-configurator .add-external-network').click(function (event) {
528
			event.preventDefault();
529
			let options = '';
530
			if (interfacesAvailable.length === 0) {
531
				options = '<option value=""></option>';
532
			} else {
533
				for (let i = 0; i < interfacesAvailable.length; i++) {
534
					options += '<option value="' + interfacesAvailable[i] + '">' + interfacesAvailable[i] + '</option>';
535
				}
536
			}
537
			$('.network-configurator .externals').append(' \
538
				<div data-network-type="external"> \
539
					<div class="network-connector" data-connector-network="internet" data-connector-direction="left"></div> \
540
					<div class="network-box"> \
541
						<div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> \
542
						<label for="ext_interface_X"><?= 'Interface' ?></label> <select name="interface" id="ext_interface_X">' + options + '</select><br> \
543
						<label for="ext_ip_X"><?= $l_ip_address ?></label> <input style="width:150px" type="text" name="ip_public" id="ext_ip_X" value="" /><br> \
544
						<label for="ext_gateway_X"><?= $l_ip_router ?></label> <input style="width:120px" type="text" name="ip_gw" id="ext_gateway_X" value="" /> \
545
					</div> \
546
					<div class="network-connector" data-connector-network="external" data-connector-direction="right"></div> \
547
				</div>');
548
			addWire($('div[data-network-type="external"]:last'));
549
		});
550
 
551
		// Add internal network
552
		$('.network-configurator .add-internal-network').click(function (event) {
553
			event.preventDefault();
554
			$('.network-configurator .internals').append(' \
555
					<div data-network-type="internal"> \
556
						<div class="network-connector" data-connector-network="internal" data-connector-direction="left"></div> \
557
						<div class="network-box"> \
558
							<div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> \
559
							<label for="int_interface_X"><?= 'Interface' ?></label> <select name="interface" id="int_interface_X" disabled><option value=""></option></select><br> \
560
							<label for="int_ip_X"><?= $l_ip_address ?></label> <input style="width:150px" type="text" name="ip_private" id="int_ip_X" value="" /><br> \
561
						</div> \
562
					</div>');
563
			addWire($('div[data-network-type="internal"]:last'));
564
		});
565
 
566
		// Remove network
567
		$('.network-configurator').on('click', '.remove-network', function (event) {
568
			event.preventDefault();
569
			$(this).parent().parent().parent().fadeOut(200, function() {
570
				const networkType = $(this).data('networkType');
571
				$(this).remove();
572
 
573
				// Update wires
574
				if (networkType === 'external') {
575
					$('div[data-network-type="internet"]>div.network-connector[data-connector-network="internet"]').connections('update');
576
					$('div[data-network-type="alcasar"]>div.network-connector[data-connector-network="external"]').connections('update');
577
				} else if (networkType === 'internal') {
578
					$('div[data-network-type="alcasar"]>div.network-connector[data-connector-network="internal"]').connections('update');
579
				}
580
			});
581
		});
582
 
583
		const addWire = function (network) {
584
			const networkType = network.data('networkType');
585
			if (networkType === 'external') {
586
				$().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' });
587
				$().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' });
588
			} else if (networkType === 'internal') {
589
				$().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' });
590
			}
2325 tom.houday 591
		};
2316 tom.houday 592
 
2325 tom.houday 593
		window.addEventListener('resize', function () {
594
			$('div.network-connector[data-connector-network]').connections('update');
595
		});
596
 
2316 tom.houday 597
		// Add wires to existing networks
598
		$('div[data-network-type="external"]').add('div[data-network-type="internal"]').each(function (index, element) {
599
			addWire($(this));
2325 tom.houday 600
		});
2316 tom.houday 601
	});
602
	</script>
318 richard 603
</head>
604
<body>
2316 tom.houday 605
	<div class="panel">
606
		<div class="panel-header"><?= $l_network_title ?></div>
607
		<div class="panel-body">
608
			<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="post">
609
				<div class="network-configurator">
610
					<div class="internet">
611
						<div data-network-type="internet">
612
							<div class="network-box">
613
								<?= $l_internet_legend ?> <img src="/images/state_<?= (($internet_connected) ? 'ok' : 'error') ?>.gif"><br>
614
								<?= $l_ip_public ?> : <?= $internet_publicIP ?><br>
615
								<label for="dns1"><?= $l_ip_dns1 ?></label> : <input style="width:120px" type="text" id="dns1" name="dns1" value="<?= $conf['DNS1'] ?>" /><br>
616
								<label for="dns2"><?= $l_ip_dns2 ?></label> : <input style="width:120px" type="text" id="dns2" name="dns2" value="<?= $conf['DNS2'] ?>" />
617
							</div>
618
							<div class="network-connector" data-connector-network="internet" data-connector-direction="right"></div>
619
						</div>
620
					</div><div class="externals">
621
						<?php foreach ($externalNetworks as $index => $network): ?>
622
							<div data-network-type="external">
623
								<div class="network-connector" data-connector-network="internet" data-connector-direction="left"></div>
624
								<div class="network-box">
625
									<!-- <div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> -->
626
									<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>
627
									<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>
628
									<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 ?>" />
629
								</div>
630
								<div class="network-connector" data-connector-network="external" data-connector-direction="right"></div>
631
							</div>
632
						<? endforeach; ?>
633
					</div><div class="alcasar">
634
						<div data-network-type="alcasar">
635
							<div class="network-connector" data-connector-network="external" data-connector-direction="left"></div>
636
							<div class="network-box">
637
								<!-- <div class="actions actions-externals">
638
									<div><a href="#" class="add-external-network" title="Ajouter un réseau externe">+</a></div>
639
								</div> -->
640
								<div class="alcasar-logo"><img src="/images/logo-alcasar.png" style="width: 100px;height: 100px;"></div>
641
								<!-- <div class="actions actions-internals">
642
									<div><a href="#" class="add-internal-network" title="Ajouter un réseau interne">+</a></div>
643
									<div><a href="#" class="add-internal-wifi-network">++</a></div>
644
								</div> -->
645
							</div>
646
							<div class="network-connector" data-connector-network="internal" data-connector-direction="right"></div>
647
						</div>
648
					</div><div class="internals">
649
						<?php foreach ($internalNetworks as $network): ?>
650
							<div data-network-type="internal">
651
								<div class="network-connector" data-connector-network="internal" data-connector-direction="left"></div>
652
								<div class="network-box">
653
									<!-- <div class="actions actions-network"><a href="#" class="remove-network" title="Supprimer ce réseau">-</a></div> -->
654
									<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>
655
									<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>
656
								</div>
657
							</div>
658
						<? endforeach; ?>
659
					</div>
660
				</div>
661
				<hr>
662
				<div style="text-align: center; margin: 5px">
663
					<input type="hidden" name="choix" value="network_change">
664
					<input type="submit" value="<?= $l_apply ?>">
665
				</div>
666
			</form>
667
		</div>
668
	</div>
669
	<br>
670
 
2304 tom.houday 671
<table width="100%" cellspacing="0" cellpadding="0" border="0">
2316 tom.houday 672
	<tr><th><?= $l_dhcp_title?></th></tr>
318 richard 673
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
674
</table>
2304 tom.houday 675
<table width="100%" cellspacing="0" cellpadding="5" border="1">
2316 tom.houday 676
	<tr><td colspan="2" valign="middle" align="left">
677
	<center><h3><?= $l_dhcp_state ?> : <?= ${'l_DHCP_'.$conf['DHCP']} ?></h3></center>
678
	<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
2324 tom.houday 679
		<select name="choix">
2316 tom.houday 680
			<option value="DHCP_Off"<?= ((!strcmp($conf['DHCP'], 'off')) ? ' selected' : '') ?>><?= $l_DHCP_off ?></option>
681
			<option value="DHCP_On"<?= ((!strcmp($conf['DHCP'], 'on')) ? ' selected' : '') ?>><?= $l_DHCP_on ?></option>
682
		</select>
683
		<input type="submit" value="<?= $l_apply ?>">
684
		<br><?= $l_DHCP_off_explain ?>
685
	</form>
686
	</td></tr>
687
 
1822 raphael.pi 688
	<?php
2316 tom.houday 689
	if ($conf['DHCP'] === 'on') {
690
		require('network2.php');
691
	}
1822 raphael.pi 692
	?>
318 richard 693
</table>
2316 tom.houday 694
<br>
2013 raphael.pi 695
 
2304 tom.houday 696
<table width="100%" cellspacing="0" cellpadding="0" border="0">
2316 tom.houday 697
	<tr><th><?= $l_local_dns?></th></tr>
1959 richard 698
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
699
</table>
2304 tom.houday 700
<table width="100%" cellspacing="0" cellpadding="5" border="1">
2316 tom.houday 701
<tr>
702
	<td width="50%" align="center">
703
		<form action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
704
		<table cellspacing="2" cellpadding="3" border="1">
2559 rexy 705
		<tr><th><?= $l_ip_address ?></th><th><?= $l_host_name ?></th><th><?= $l_del ?></th></tr>
2316 tom.houday 706
		<?php
707
		// Read the "dns_local" file
708
		$line_exist = false;
709
		$tab = file(DNS_LOCAL_FILE);
710
		if ($tab) { // not empty
711
			foreach ($tab as $line) {
2559 rexy 712
				if (preg_match ('/^\d+/', $line)) { # begin with one or several digit
2316 tom.houday 713
					$line_exist = true;
2559 rexy 714
					$field = preg_split("/\s+/",$line); # split with one or several whitespace (or tab)
715
					$ip_addr   = $field[0];
2316 tom.houday 716
					$host_name = $field[1];
2559 rexy 717
					echo "<tr><td>$ip_addr</td>";
718
					echo "<td>$host_name</td>";
719
					if (($ip_addr == "127.0.0.1")|($host_name == "alcasar")) {
720
						echo "<td>";}
721
					else {
722
						echo "<td><input type=\"checkbox\" name=\"$ip_addr|$host_name\">";
723
					}
724
					echo "</td></tr>";
2316 tom.houday 725
				}
1959 richard 726
			}
727
		}
2316 tom.houday 728
		if (!$line_exist) {
729
			echo '<tr><td colspan="3" style="text-align: center;font-style: italic;">'.$l_empty.'</td></tr>';
730
		}
731
		?>
732
		</table>
733
		<?php if ($line_exist): ?>
734
			<input type="hidden" name="choix" value="del_host">
735
			<input type="submit" value="<?= $l_apply ?>">
736
		<?php endif; ?>
737
		</form>
738
	</td>
739
	<td width="50%" valign="middle" align="center">
740
		<form name="new_host" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" method="POST">
741
		<table cellspacing="2" cellpadding="3" border="1">
742
		<tr>
2559 rexy 743
			<th><?= $l_ip_address ?></th><th><?= $l_host_name ?></th><td></td>
2316 tom.houday 744
		</tr>
745
		<tr>
2559 rexy 746
			<td>Ex. : 192.168.182.10</td><td>Ex. : my_nas</td><td></td>
2316 tom.houday 747
		</tr>
748
		<tr>
2559 rexy 749
			<td><input type="text" name="add_ip" size="10"><input type="hidden" name="choix" value="new_host"></td>
2316 tom.houday 750
			<td><input type="text" name="add_host" size="17"></td>
751
			<td><input type=submit class=button value="<?= $l_add_to_list ?>"></td>
752
		</tr>
753
		</table>
754
		</form>
755
	</td>
756
</tr>
1959 richard 757
</table>
2316 tom.houday 758
<br>
759
 
2304 tom.houday 760
<table width="100%" cellspacing="0" cellpadding="0" border="0">
2316 tom.houday 761
	<tr><th><?= $l_import_cert ?></th></tr>
1710 richard 762
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
763
</table>
2304 tom.houday 764
<table width="100%" cellspacing="0" cellpadding="5" border="1">
765
	<tr>
2324 tom.houday 766
		<td width="50%" valign="top">
767
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
768
				<input type="hidden" name="choix" value="https_login">
2326 tom.houday 769
				<span><?= $l_allow_unsecured_login ?></span><br>
2324 tom.houday 770
				<select name="https_login">
2326 tom.houday 771
					<option value="on"<?=  (($conf['HTTPS_LOGIN'] === 'on')  ? ' selected' : '') ?>><?= $l_no ?></option>
772
					<option value="off"<?= (($conf['HTTPS_LOGIN'] === 'off') ? ' selected' : '') ?>><?= $l_yes ?></option>
2324 tom.houday 773
				</select>
774
				<input type="submit" value="<?= $l_apply ?>"><br>
2326 tom.houday 775
				<span><?= $l_unsecured_login_warning ?></span>
2297 tom.houday 776
			</form>
2324 tom.houday 777
			<br>
778
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
779
				<input type="hidden" name="choix" value="default_cert">
780
				<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' : '' ?>>
781
			</form>
782
		</td>
783
		<td width="50%" valign="top">
2297 tom.houday 784
			<?php
785
			$certificateInfos = openssl_x509_parse(file_get_contents('/etc/pki/tls/certs/alcasar.crt'));
786
 
787
			$cert_expiration_date = date('d-m-Y H:i:s', $certificateInfos['validTo_time_t']);
788
			$domain               = $certificateInfos['subject']['CN'];
789
			$organization         = (isset($certificateInfos['subject']['O'])) ? $certificateInfos['subject']['O'] : '';
790
			$CAdomain             = $certificateInfos['issuer']['CN'];
791
			$CAorganization       = (isset($certificateInfos['issuer']['O'])) ? $certificateInfos['issuer']['O'] : '';
792
			?>
793
			<h3><?= $l_current_certificate ?></h3>
2326 tom.houday 794
			<?= $l_cert_expiration ?> <?= $cert_expiration_date ?><br>
795
			<?= $l_cert_commonname ?> <?= $domain ?><br>
796
			<?= $l_cert_organization ?> <?= $organization ?><br/>
2297 tom.houday 797
			<h4><?=  $l_validated ?></h4>
2326 tom.houday 798
			<?= $l_cert_commonname ?> <?= $CAdomain ?><br>
799
			<?= $l_cert_organization ?> <?= $CAorganization ?><br>
2324 tom.houday 800
		</td>
801
	</tr>
802
	<tr>
803
		<td width="50%" valign="top">
2326 tom.houday 804
			<h3><?= $l_upload_certificate ?></h3>
2324 tom.houday 805
			<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>" enctype="multipart/form-data">
806
				<?= $l_private_key;?> <input type="file" name="key"><br>
807
				<?= $l_certificate;?> <input type="file" name="crt"><br>
808
				<?= $l_server_chain;?> <input type="file" name="sc"><br>
809
				<input type="hidden" name="choix" value="import_cert">
810
				<input type="submit" value="<?= $l_import ?>">
2297 tom.houday 811
			</form>
812
		</td>
2304 tom.houday 813
		<td width="50%" valign="top">
814
			<?php
815
			// Get step
816
			if (empty($LE_conf['domainRequest'])) {
817
				$step = 1;
818
			} else if (!empty($LE_conf['challenge'])) {
819
				$step = 2;
820
			} else if (($domain === $LE_conf['domainRequest']) && (empty($LE_conf['challenge']))) {
821
				$step = 3;
822
			} else {
823
				$step = 1;
824
			}
825
			?>
2326 tom.houday 826
			<h3><?= $l_le_integration ?></h3>
2324 tom.houday 827
			<?php if ($step === 1): ?>
2316 tom.houday 828
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
829
					<input type="hidden" name="choix" value="le_issueCert">
2326 tom.houday 830
					<?= $l_le_status ?> <?= $l_disabled ?><br>
831
					<?= $l_le_email ?> <input type="text" name="email" placeholder="adresse@email.com"<?= ((!empty($LE_conf['email'])) ? ' value="'.$LE_conf['email'].'"' : '') ?>><br>
832
					<?= $l_le_domain_name ?> <input type="text" name="domainname" placeholder="alcasar.domain.tld" required><br>
833
					<input type="submit" name="issue" value="<?= $l_send ?>"><br>
2304 tom.houday 834
				</form>
835
			<?php elseif ($step === 2): ?>
2316 tom.houday 836
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
837
					<input type="hidden" name="choix" value="le_renewCert">
2326 tom.houday 838
					<?= $l_le_status ?> <?= $l_pending_validation ?><br>
839
					<?= $l_le_domain_name ?> <?= $LE_conf['domainRequest'] ?><br>
840
					<?= $l_le_ask_on ?> <?= date('d-m-Y H:i:s', $LE_conf['dateIssueRequest']) ?><br>
841
					<?= $l_le_dns_entry_txt ?> "<?= '_acme-challenge.'.$LE_conf['domainRequest'] ?>"<br>
842
					<?= $l_le_challenge ?> "<?= $LE_conf['challenge'] ?>"<br>
843
					<input type="submit" name="recheck" value="<?= $l_recheck ?>"> <input type="submit" name="cancel" value="<?= $l_cancel ?>"><br>
2304 tom.houday 844
				</form>
845
			<?php elseif ($step === 3): ?>
2316 tom.houday 846
				<form method="post" action="<?= htmlspecialchars($_SERVER['PHP_SELF']) ?>">
847
					<input type="hidden" name="choix" value="le_renewCert">
2326 tom.houday 848
					<?= $l_le_status ?> <?= $l_enabled ?><br>
849
					<?= $l_le_domain_name ?> <?= $LE_conf['domainRequest'] ?><br>
850
					<?= $l_le_api ?>  <?= $LE_conf['dnsapi'] ?><br>
851
					<?= $l_le_next_renewal ?> <?= date('d-m-Y', $LE_conf['dateNextRenewal']) ?><br>
2304 tom.houday 852
					<?php if ($LE_conf['dateNextRenewal'] <= date('U')): ?>
2326 tom.houday 853
						<input type="submit" name="recheck" value="<?= $l_renew ?>"><br>
2304 tom.houday 854
					<?php else: ?>
2326 tom.houday 855
						<input type="submit" name="recheck_force" value="<?= $l_renew_force ?>"><br>
2304 tom.houday 856
					<?php endif; ?>
857
				</form>
858
			<?php endif; ?>
859
			<?php if (isset($cmdResponse)): ?>
860
				<p><?= $cmdResponse ?></p>
861
			<?php endif; ?>
862
		</td>
1710 richard 863
	</tr>
864
</table>
318 richard 865
</body>
866
</html>