Subversion Repositories ALCASAR

Rev

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