Subversion Repositories ALCASAR

Rev

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