Subversion Repositories ALCASAR

Rev

Rev 2265 | Rev 2277 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

Rev 2265 Rev 2274
1
<?php
1
<?php
2
/* written by steweb57 & Rexy */
2
/* written by steweb57 & Rexy */
3
 
3
 
4
/********************
4
/********************
5
* READ CONF FILES   *
5
* READ CONF FILES   *
6
*********************/
6
*********************/
7
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
7
define ("CONF_FILE", "/usr/local/etc/alcasar.conf");
8
define ("ETHERS_FILE", "/usr/local/etc/alcasar-ethers");
8
define ("ETHERS_FILE", "/usr/local/etc/alcasar-ethers");
-
 
9
define ("ETHERS_INFO_FILE", "/usr/local/etc/alcasar-ethers-info");
9
define ("DNS_LOCAL_FILE", "/usr/local/etc/alcasar-dns-name");
10
define ("DNS_LOCAL_FILE", "/usr/local/etc/alcasar-dns-name");
10
$conf_files=array(CONF_FILE,ETHERS_FILE,DNS_LOCAL_FILE);
11
$conf_files=array(CONF_FILE,ETHERS_FILE,ETHERS_INFO_FILE,DNS_LOCAL_FILE);
11
$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])$/';
12
$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])$/';
12
$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]))$/';
13
$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]))$/';
13
$network_modification=0;
14
$network_modification=0;
14
foreach ($conf_files as $file){
15
foreach ($conf_files as $file){
15
if (!file_exists($file)){
16
if (!file_exists($file)){
16
	exit("Requested file ".$file." isn't present");}
17
	exit("Requested file ".$file." isn't present");}
17
if (!is_readable($file)){
18
if (!is_readable($file)){
18
	exit("Can't read the file ".$file);}
19
	exit("Can't read the file ".$file);}
19
}
20
}
20
# Choice of language
21
# Choice of language
21
$Language = 'en';
22
$Language = 'en';
22
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
23
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
23
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
24
	$Langue		= explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
24
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
25
	$Language	= strtolower(substr(chop($Langue[0]),0,2)); }
25
if($Language == 'fr'){
26
if($Language == 'fr'){
26
	$l_network_title	= "Configuration réseau";
27
	$l_network_title	= "Configuration réseau";
27
	$l_extif_legend		= " (Interface connectée à Internet)";
28
	$l_extif_legend		= " (Interface connectée à Internet)";
28
	$l_intif_legend		= " (Réseau de consultation)";
29
	$l_intif_legend		= " (Réseau de consultation)";
29
	$l_internet_legend	= "INTERNET";
30
	$l_internet_legend	= "INTERNET";
30
	$l_ip_mask		= "Masque";
31
	$l_ip_mask		= "Masque";
31
	$l_ip_router		= "Passerelle";
32
	$l_ip_router		= "Passerelle";
32
	$l_ip_public		= "Adresse IP publique";
33
	$l_ip_public		= "Adresse IP publique";
33
	$l_ip_dns1		= "DNS1";
34
	$l_ip_dns1		= "DNS1";
34
	$l_ip_dns2		= "DNS2";
35
	$l_ip_dns2		= "DNS2";
35
	$l_dhcp_title		= "Service DHCP";
36
	$l_dhcp_title		= "Service DHCP";
36
	$l_dhcp_state		= "Mode actuel";
37
	$l_dhcp_state		= "Mode actuel";
37
	$l_DHCP_on		= "actif";
38
	$l_DHCP_on		= "actif";
38
	$l_DHCP_off		= "inactif";
39
	$l_DHCP_off		= "inactif";
39
	$l_DHCP_off_explain	= "! Avant d'arrêter le serveur DHCP, vous devez renseigner les paramètres d'un serveur externe (cf. documentation).";
40
	$l_DHCP_off_explain	= "! Avant d'arrêter le serveur DHCP, vous devez renseigner les paramètres d'un serveur externe (cf. documentation).";
40
	$l_static_dhcp_title	= "Réservation d'adresses IP statiques";
41
	$l_static_dhcp_title	= "Réservation d'adresses IP statiques";
41
	$l_mac_address		= "Adresse MAC";
42
	$l_mac_address		= "Adresse MAC";
42
	$l_ip_address		= "Adresse IP";
43
	$l_ip_address		= "Adresse IP";
43
	$l_host_name		= "Nom d'hôte";
44
	$l_host_name		= "Nom d'hôte";
44
	$l_del			= "Supprimer de la liste";
45
	$l_del			= "Supprimer de la liste";
45
	$l_add_to_list		= "Ajouter";
46
	$l_add_to_list		= "Ajouter";
46
	$l_apply		= "Appliquer les changements";
47
	$l_apply		= "Appliquer les changements";
47
	$l_local_dns		= "Résolution local de nom";
48
	$l_local_dns		= "Résolution local de nom";
48
	$l_import_cert		= "Import de certificat";
49
	$l_import_cert		= "Import de certificat";
49
	$l_private_key		= "Clé privée (.key) :";
50
	$l_private_key		= "Clé privée (.key) :";
50
	$l_certificate		= "Certificat (.crt) :";
51
	$l_certificate		= "Certificat (.crt) :";
51
	$l_server_chain		= "Chaîne de certification (si nécéssaire : .crt) :";
52
	$l_server_chain		= "Chaîne de certification (si nécéssaire : .crt) :";
52
	$l_default_cert		= "Revenir au certificat d'origine";
53
	$l_default_cert		= "Revenir au certificat d'origine";
53
	$l_import		= "Importer";
54
	$l_import		= "Importer";
54
	$l_current_certificate  = "Certificat actuel";
55
	$l_current_certificate  = "Certificat actuel";
55
	$l_validated		= "Validé par :";
56
	$l_validated		= "Validé par :";
56
} else {
57
} else {
57
	$l_network_title	= "Network configuration";
58
	$l_network_title	= "Network configuration";
58
	$l_extif_legend		= " (Internet connected interface)";
59
	$l_extif_legend		= " (Internet connected interface)";
59
	$l_intif_legend		= " (Private network)";
60
	$l_intif_legend		= " (Private network)";
60
	$l_internet_legend	= "INTERNET";
61
	$l_internet_legend	= "INTERNET";
61
	$l_ip_mask		= "Mask";
62
	$l_ip_mask		= "Mask";
62
	$l_ip_router		= "Gateway";
63
	$l_ip_router		= "Gateway";
63
	$l_ip_public		= "Public IP address";
64
	$l_ip_public		= "Public IP address";
64
	$l_ip_dns1		= "DNS1";
65
	$l_ip_dns1		= "DNS1";
65
	$l_ip_dns2		= "DNS2";
66
	$l_ip_dns2		= "DNS2";
66
	$l_dhcp_title		= "DHCP service";
67
	$l_dhcp_title		= "DHCP service";
67
	$l_dhcp_state		= "Current mode";
68
	$l_dhcp_state		= "Current mode";
68
	$l_DHCP_on		= "enabled";
69
	$l_DHCP_on		= "enabled";
69
	$l_DHCP_off		= "disabled";
70
	$l_DHCP_off		= "disabled";
70
	$l_DHCP_off_explain	= "! Before disabling the DHCP server, you must write the extern DHCP parameters in the config file (see Documentation)";
71
	$l_DHCP_off_explain	= "! Before disabling the DHCP server, you must write the extern DHCP parameters in the config file (see Documentation)";
71
	$l_static_dhcp_title	= "Static IP addresses reservation";
72
	$l_static_dhcp_title	= "Static IP addresses reservation";
72
	$l_mac_address		= "MAC Address";
73
	$l_mac_address		= "MAC Address";
73
	$l_ip_address		= "IP Address";
74
	$l_ip_address		= "IP Address";
74
	$l_host_name		= "Host name";
75
	$l_host_name		= "Host name";
75
	$l_del			= "Delete from list";
76
	$l_del			= "Delete from list";
76
	$l_add_to_list		= "Add";
77
	$l_add_to_list		= "Add";
77
	$l_apply		= "Apply changes";
78
	$l_apply		= "Apply changes";
78
	$l_local_dns		= "Local name resolution";
79
	$l_local_dns		= "Local name resolution";
79
	$l_import_cert		= "Certificate import";
80
	$l_import_cert		= "Certificate import";
80
	$l_private_key		= "Private key (.key) :";
81
	$l_private_key		= "Private key (.key) :";
81
	$l_certificate		= "Certificate (.crt) :";
82
	$l_certificate		= "Certificate (.crt) :";
82
	$l_server_chain		= "Server-chain (if necessary : .crt) :";
83
	$l_server_chain		= "Server-chain (if necessary : .crt) :";
83
	$l_default_cert		= "Back to default certificate";
84
	$l_default_cert		= "Back to default certificate";
84
	$l_import		= "Import";
85
	$l_import		= "Import";
85
	$l_current_certificate  = "Current certificate";
86
	$l_current_certificate  = "Current certificate";
86
	$l_validated		= "Validated by :";
87
	$l_validated		= "Validated by :";
87
}
88
}
88
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
89
if (isset($_POST['choix'])){$choix=$_POST['choix'];} else {$choix="";}
89
switch ($choix)
90
switch ($choix)
90
{
91
{
91
case 'DHCP_On' :
92
case 'DHCP_On' :
92
	exec ("sudo /usr/local/bin/alcasar-dhcp.sh -on");
93
	exec ("sudo /usr/local/bin/alcasar-dhcp.sh -on");
93
	break;
94
	break;
94
case 'DHCP_Off' :
95
case 'DHCP_Off' :
95
	exec ("sudo /usr/local/bin/alcasar-dhcp.sh -off");
96
	exec ("sudo /usr/local/bin/alcasar-dhcp.sh -off");
96
	break;
97
	break;
97
case 'new_mac' :
98
case 'new_mac' :
98
	if ((trim($_POST['add_mac']) != "") and (trim($_POST['add_ip']) != ""))
99
	if ((trim($_POST['add_mac']) != "") and (trim($_POST['add_ip']) != ""))
99
		{
100
		{
100
		$tab=file(ETHERS_FILE);
101
		$tab=file(ETHERS_FILE);
101
		if ($tab)  # the file isn't empty
102
		if ($tab)  # the file isn't empty
102
			{
103
			{
103
			$insert="True";
104
			$insert="True";
104
			$new_mac_addr=trim($_POST['add_mac'],"\x00..\x20");
105
			$new_mac_addr=trim($_POST['add_mac'],"\x00..\x20");
105
			$new_ip_addr=trim($_POST['add_ip'],"\x00..\x20");
106
			$new_ip_addr=trim($_POST['add_ip'],"\x00..\x20");
106
			foreach ($tab as $line)  # verify that MAC or IP address doesn't exist
107
			foreach ($tab as $line)  # verify that MAC or IP address doesn't exist
107
				{
108
				{
108
				$field=explode(" ", $line);
109
				$field=explode(" ", $line);
109
				$mac_addr=trim($field[0]);$ip_addr=trim($field[1]);
110
				$mac_addr=trim($field[0]);$ip_addr=trim($field[1]);
110
				if (strcasecmp($new_mac_addr, $mac_addr) == 0)
111
				if (strcasecmp($new_mac_addr, $mac_addr) == 0)
111
					{
112
					{
112
					$insert="False";
113
					$insert="False";
113
					break;
114
					break;
114
					}
115
					}
115
				if (strcasecmp($new_ip_addr, $ip_addr) == 0)
116
				if (strcasecmp($new_ip_addr, $ip_addr) == 0)
116
					{
117
					{
117
					$insert="False";
118
					$insert="False";
118
					break;
119
					break;
119
					}
120
					}
120
				}
121
				}
121
			if ($insert == "True")
122
			if ($insert == "True")
122
				{
123
				{
123
				$line = $new_mac_addr . " " . $new_ip_addr . " #" . trim($_POST['info'],"\x00..\x20") . "\n";
124
				$line = $new_mac_addr . " " . $new_ip_addr . "\n";
124
				$pointeur=fopen(ETHERS_FILE,"a");
125
				$pointeur=fopen(ETHERS_FILE,"a");
125
				fwrite ($pointeur, $line);
126
				fwrite ($pointeur, $line);
126
				fclose ($pointeur);
127
				fclose ($pointeur);
-
 
128
				$pointeur=fopen(ETHERS_INFO_FILE,"a");
-
 
129
				fwrite ($pointeur, $line);
-
 
130
				fclose ($pointeur);
-
 
131
				$line = $new_mac_addr . " " . $new_ip_addr . " #" . trim($_POST['info'],"\x00..\x20") . "\n";
127
				exec ("sudo /usr/bin/systemctl reload chilli");
132
				exec ("sudo /usr/bin/systemctl reload chilli");
128
				}
133
				}
129
			}
134
			}
130
		}
135
		}
131
	break;
136
	break;
132
case 'del_mac' :
137
case 'del_mac' :
133
	foreach ($_POST as $key => $value)
138
	foreach ($_POST as $key => $value)
134
		{
139
		{
135
		if ($value == 'on')
140
		if ($value == 'on')
136
			{
141
			{
137
			$ether_file=ETHERS_FILE;
142
			$ether_file=ETHERS_FILE;
138
			exec("/bin/sed -i \"/^$key/d\" $ether_file"); 
143
			exec("/bin/sed -i \"/^$key/d\" $ether_file"); 
-
 
144
			$ether_file=ETHERS_INFO_FILE;
-
 
145
			exec("/bin/sed -i \"/^$key/d\" $ether_file"); 
139
			exec ("sudo /usr/bin/systemctl reload chilli");
146
			exec ("sudo /usr/bin/systemctl reload chilli");
140
			}
147
			}
141
		}
148
		}
142
	break;
149
	break;
143
case 'new_host' :
150
case 'new_host' :
144
	if ((trim($_POST['add_host']) != "") and (trim($_POST['add_ip']) != ""))
151
	if ((trim($_POST['add_host']) != "") and (trim($_POST['add_ip']) != ""))
145
		{
152
		{
146
		$tab=file(DNS_LOCAL_FILE);
153
		$tab=file(DNS_LOCAL_FILE);
147
		$insert="True";
154
		$insert="True";
148
		if ($tab)  # the file isn't empty
155
		if ($tab)  # the file isn't empty
149
			{
156
			{
150
			foreach ($tab as $line)  # verify that host or IP address doesn't exist
157
			foreach ($tab as $line)  # verify that host or IP address doesn't exist
151
				{
158
				{
152
				if (preg_match ('/^address/', $line))
159
				if (preg_match ('/^address/', $line))
153
					{
160
					{
154
					$field=explode("/", $line);
161
					$field=explode("/", $line);
155
					$host_name=trim($field[1]);$ip_addr=trim($field[2]);
162
					$host_name=trim($field[1]);$ip_addr=trim($field[2]);
156
					if (strcasecmp(trim($_POST['add_host']),trim($host_name)) == 0)
163
					if (strcasecmp(trim($_POST['add_host']),trim($host_name)) == 0)
157
						{
164
						{
158
						$insert="False";
165
						$insert="False";
159
						break;
166
						break;
160
						}
167
						}
161
					if (strcasecmp(trim($_POST['add_ip']), trim($ip_addr)) == 0)
168
					if (strcasecmp(trim($_POST['add_ip']), trim($ip_addr)) == 0)
162
						{
169
						{
163
						$insert="False";
170
						$insert="False";
164
						break;
171
						break;
165
						}
172
						}
166
					}
173
					}
167
				}
174
				}
168
			if ($insert == "True")
175
			if ($insert == "True")
169
				{
176
				{
170
				$line1 = "address=/".trim($_POST['add_host'])."/".trim($_POST['add_ip'])."\n";
177
				$line1 = "address=/".trim($_POST['add_host'])."/".trim($_POST['add_ip'])."\n";
171
				$explode_ip=explode('.',trim($_POST['add_ip']));
178
				$explode_ip=explode('.',trim($_POST['add_ip']));
172
				$reverse_ip=implode('.',array_reverse($explode_ip));
179
				$reverse_ip=implode('.',array_reverse($explode_ip));
173
				$line2 = "ptr-record=".$reverse_ip.".in-addr.arpa,".trim($_POST['add_host'])."\n";
180
				$line2 = "ptr-record=".$reverse_ip.".in-addr.arpa,".trim($_POST['add_host'])."\n";
174
				$pointeur=fopen(DNS_LOCAL_FILE,"a");
181
				$pointeur=fopen(DNS_LOCAL_FILE,"a");
175
				fwrite ($pointeur, $line1);
182
				fwrite ($pointeur, $line1);
176
				fwrite ($pointeur, $line2);
183
				fwrite ($pointeur, $line2);
177
				fclose ($pointeur);
184
				fclose ($pointeur);
178
				exec ("sudo /usr/bin/systemctl restart dnsmasq");
185
				exec ("sudo /usr/bin/systemctl restart dnsmasq");
179
				exec ("sudo /usr/bin/systemctl restart dnsmasq-blacklist");
186
				exec ("sudo /usr/bin/systemctl restart dnsmasq-blacklist");
180
				exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist");
187
				exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist");
181
				}
188
				}
182
			}
189
			}
183
		}
190
		}
184
	break;
191
	break;
185
case 'del_host' :
192
case 'del_host' :
186
	foreach ($_POST as $key => $value)
193
	foreach ($_POST as $key => $value)
187
		{
194
		{
188
		if ($value == 'on')
195
		if ($value == 'on')
189
			{
196
			{
190
			$dns_local_file=DNS_LOCAL_FILE;
197
			$dns_local_file=DNS_LOCAL_FILE;
191
			exec("/bin/sed -i \"/$key/d\" $dns_local_file"); 
198
			exec("/bin/sed -i \"/$key/d\" $dns_local_file"); 
192
			exec ("sudo /usr/bin/systemctl restart dnsmasq");
199
			exec ("sudo /usr/bin/systemctl restart dnsmasq");
193
			exec ("sudo /usr/bin/systemctl restart dnsmasq-blacklist");
200
			exec ("sudo /usr/bin/systemctl restart dnsmasq-blacklist");
194
			exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist");
201
			exec ("sudo /usr/bin/systemctl restart dnsmasq-whitelist");
195
			}
202
			}
196
		}
203
		}
197
	break;
204
	break;
198
}
205
}
199
 
206
 
200
// Fonction de test de connectivité internet
207
// Fonction de test de connectivité internet
201
function internetTest(){
208
function internetTest(){
202
	$host = "www.google.fr"; # Google Test
209
	$host = "www.google.fr"; # Google Test
203
	$port = "80";
210
	$port = "80";
204
	//var $num;	//not used
211
	//var $num;	//not used
205
	//var $error;	//not used
212
	//var $error;	//not used
206
 
213
 
207
	if (! $sock = @fsockopen($host, $port, $num, $error, 5)) {
214
	if (! $sock = @fsockopen($host, $port, $num, $error, 5)) {
208
		return false;
215
		return false;
209
	} else {
216
	} else {
210
		fclose($sock);
217
		fclose($sock);
211
		return true;
218
		return true;
212
	}
219
	}
213
}
220
}
214
/***********************************
221
/***********************************
215
* 	Update ALCASAR_CONF_FILE   *
222
* 	Update ALCASAR_CONF_FILE   *
216
***********************************/
223
***********************************/
217
/*******************************************
224
/*******************************************
218
*	Read ALCASAR_CONF_FILE Before     *
225
*	Read ALCASAR_CONF_FILE Before     *
219
********************************************/
226
********************************************/
220
$ouvre=fopen(CONF_FILE,"r");
227
$ouvre=fopen(CONF_FILE,"r");
221
if ($ouvre){
228
if ($ouvre){
222
	while (!feof ($ouvre))
229
	while (!feof ($ouvre))
223
	{
230
	{
224
		$tampon = fgets($ouvre, 4096);
231
		$tampon = fgets($ouvre, 4096);
225
		if (strpos($tampon,"=")!==false){
232
		if (strpos($tampon,"=")!==false){
226
			$tmp = explode("=",$tampon);
233
			$tmp = explode("=",$tampon);
227
			$conf[$tmp[0]] = $tmp[1];
234
			$conf[$tmp[0]] = $tmp[1];
228
		}
235
		}
229
	}
236
	}
230
	fclose($ouvre);
237
	fclose($ouvre);
231
}
238
}
232
	
239
	
233
if(isset($_POST['dns1']) && preg_match($reg_ip,$_POST['dns1']))
240
if(isset($_POST['dns1']) && preg_match($reg_ip,$_POST['dns1']))
234
{
241
{
235
	file_put_contents(CONF_FILE, str_replace('DNS1='.$conf['DNS1'],'DNS1='.$_POST['dns1']."\n",file_get_contents(CONF_FILE)));
242
	file_put_contents(CONF_FILE, str_replace('DNS1='.$conf['DNS1'],'DNS1='.$_POST['dns1']."\n",file_get_contents(CONF_FILE)));
236
	$network_modification=1;
243
	$network_modification=1;
237
}
244
}
238
if(isset($_POST['dns2']) && preg_match($reg_ip,$_POST['dns2']))
245
if(isset($_POST['dns2']) && preg_match($reg_ip,$_POST['dns2']))
239
{
246
{
240
	file_put_contents(CONF_FILE, str_replace('DNS2='.$conf['DNS2'],'DNS2='.$_POST['dns2']."\n",file_get_contents(CONF_FILE)));
247
	file_put_contents(CONF_FILE, str_replace('DNS2='.$conf['DNS2'],'DNS2='.$_POST['dns2']."\n",file_get_contents(CONF_FILE)));
241
	$network_modification=1;
248
	$network_modification=1;
242
}
249
}
243
 
250
 
244
if(isset($_POST['ip_public']) && preg_match($reg_ip_cidr,$_POST['ip_public']))
251
if(isset($_POST['ip_public']) && preg_match($reg_ip_cidr,$_POST['ip_public']))
245
{
252
{
246
	file_put_contents(CONF_FILE, str_replace('PUBLIC_IP='.$conf['PUBLIC_IP'],'PUBLIC_IP='.$_POST['ip_public']."\n",file_get_contents(CONF_FILE)));
253
	file_put_contents(CONF_FILE, str_replace('PUBLIC_IP='.$conf['PUBLIC_IP'],'PUBLIC_IP='.$_POST['ip_public']."\n",file_get_contents(CONF_FILE)));
247
	$network_modification=1;
254
	$network_modification=1;
248
}
255
}
249
 
256
 
250
if(isset($_POST['ip_gw']) && preg_match($reg_ip,$_POST['ip_gw']))
257
if(isset($_POST['ip_gw']) && preg_match($reg_ip,$_POST['ip_gw']))
251
{
258
{
252
	file_put_contents(CONF_FILE, str_replace('GW='.$conf['GW'],'GW='.$_POST['ip_gw']."\n",file_get_contents(CONF_FILE)));
259
	file_put_contents(CONF_FILE, str_replace('GW='.$conf['GW'],'GW='.$_POST['ip_gw']."\n",file_get_contents(CONF_FILE)));
253
	$network_modification=1;
260
	$network_modification=1;
254
}
261
}
255
 
262
 
256
if(isset($_POST['ip_private']) && preg_match($reg_ip_cidr,$_POST['ip_private']))
263
if(isset($_POST['ip_private']) && preg_match($reg_ip_cidr,$_POST['ip_private']))
257
{
264
{
258
	file_put_contents(CONF_FILE, str_replace('PRIVATE_IP='.$conf['PRIVATE_IP'],'PRIVATE_IP='.$_POST['ip_private']."\n",file_get_contents(CONF_FILE)));
265
	file_put_contents(CONF_FILE, str_replace('PRIVATE_IP='.$conf['PRIVATE_IP'],'PRIVATE_IP='.$_POST['ip_private']."\n",file_get_contents(CONF_FILE)));
259
	$network_modification=1;
266
	$network_modification=1;
260
}
267
}
261
if($network_modification)
268
if($network_modification)
262
{
269
{
263
	exec("sudo /usr/local/bin/alcasar-conf.sh -apply");
270
	exec("sudo /usr/local/bin/alcasar-conf.sh -apply");
264
}
271
}
265
 
272
 
266
/*******************************************
273
/*******************************************
267
*	Read ALCASAR_CONF_FILE Updated     *
274
*	Read ALCASAR_CONF_FILE Updated     *
268
********************************************/
275
********************************************/
269
$ouvre=fopen(CONF_FILE,"r");
276
$ouvre=fopen(CONF_FILE,"r");
270
if ($ouvre){
277
if ($ouvre){
271
	while (!feof ($ouvre))
278
	while (!feof ($ouvre))
272
	{
279
	{
273
		$tampon = fgets($ouvre, 4096);
280
		$tampon = fgets($ouvre, 4096);
274
		if (strpos($tampon,"=")!==false){
281
		if (strpos($tampon,"=")!==false){
275
			$tmp = explode("=",$tampon);
282
			$tmp = explode("=",$tampon);
276
			$conf[$tmp[0]] = $tmp[1];
283
			$conf[$tmp[0]] = $tmp[1];
277
		}
284
		}
278
	}
285
	}
279
	fclose($ouvre);
286
	fclose($ouvre);
280
}
287
}
281
?>
288
?>
282
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
289
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
283
<html><!-- written by steweb57 & rexy -->
290
<html><!-- written by steweb57 & rexy -->
284
<head>
291
<head>
285
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
292
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
286
<title><?php echo $l_network_title; ?></title>
293
<title><?php echo $l_network_title; ?></title>
287
<link rel="stylesheet" href="/css/style.css" type="text/css">
294
<link rel="stylesheet" href="/css/style.css" type="text/css">
288
<script type="text/javascript">
295
<script type="text/javascript">
289
function MAC_Control(formulaire){
296
function MAC_Control(formulaire){
290
/*MAC control (upper case and '-' separator*/
297
/*MAC control (upper case and '-' separator*/
291
	var regex1 = /^([0-9a-fA-F]{2}(-|:)){5}[0-9a-fA-F]{2}$/; //vérification adresse mac
298
	var regex1 = /^([0-9a-fA-F]{2}(-|:)){5}[0-9a-fA-F]{2}$/; //vérification adresse mac
292
	if (regex1.test(document.forms[formulaire].add_mac.value)){
299
	if (regex1.test(document.forms[formulaire].add_mac.value)){
293
		document.forms[formulaire].add_mac.value=document.forms[formulaire].add_mac.value.toUpperCase().replace(/:/g, '-');
300
		document.forms[formulaire].add_mac.value=document.forms[formulaire].add_mac.value.toUpperCase().replace(/:/g, '-');
294
		return true;
301
		return true;
295
	} else {
302
	} else {
296
		alert("Invalid MAC address");//non internationnalisé
303
		alert("Invalid MAC address");//non internationnalisé
297
		return false;
304
		return false;
298
	}
305
	}
299
}
306
}
300
</script>
307
</script>
301
</head>
308
</head>
302
<body>
309
<body>
303
<table width="100%" border="0" cellspacing="0" cellpadding="0">
310
<table width="100%" border="0" cellspacing="0" cellpadding="0">
304
	<tr><th><?php echo $l_network_title; ?></th></tr>
311
	<tr><th><?php echo $l_network_title; ?></th></tr>
305
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
312
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
306
</table>
313
</table>
307
<? echo "<form action=".$_SERVER['PHP_SELF']." method='post'>";?>
314
<? echo "<form action=".$_SERVER['PHP_SELF']." method='post'>";?>
308
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
315
<TABLE width="100%" border=1 cellspacing=0 cellpadding=1>
309
	<tr><td valign="middle" align="left">
316
	<tr><td valign="middle" align="left">
310
	<fieldset>
317
	<fieldset>
311
	<legend><?php echo $l_internet_legend;
318
	<legend><?php echo $l_internet_legend;
312
 	if (InternetTest()){
319
 	if (InternetTest()){
313
		echo " <img src='/images/state_ok.gif'>";
320
		echo " <img src='/images/state_ok.gif'>";
314
		$IP_PUB = exec ("wget http://ipecho.net/plain -O - -o /dev/null");}
321
		$IP_PUB = exec ("wget http://ipecho.net/plain -O - -o /dev/null");}
315
	else 	{
322
	else 	{
316
		echo " <img src='/images/state_error.gif'>";
323
		echo " <img src='/images/state_error.gif'>";
317
		$IP_PUB = "-.-.-.-";}
324
		$IP_PUB = "-.-.-.-";}
318
	?></legend>
325
	?></legend>
319
	<table>
326
	<table>
320
		<tr><td><?php echo $l_ip_public." : ".$IP_PUB;?></td></tr>
327
		<tr><td><?php echo $l_ip_public." : ".$IP_PUB;?></td></tr>
321
		<?php
328
		<?php
322
		echo "<tr><td>".$l_ip_dns1." <input style='width:120px' type='text' name='dns1' value=".$conf["DNS1"]."/></td></tr>";
329
		echo "<tr><td>".$l_ip_dns1." <input style='width:120px' type='text' name='dns1' value=".$conf["DNS1"]."/></td></tr>";
323
		echo "<tr><td>".$l_ip_dns2." <input style='width:120px' type='text' name='dns2' value=".$conf["DNS2"]."/></td></tr>";
330
		echo "<tr><td>".$l_ip_dns2." <input style='width:120px' type='text' name='dns2' value=".$conf["DNS2"]."/></td></tr>";
324
		?>
331
		?>
325
	</table>
332
	</table>
326
	</fieldset>
333
	</fieldset>
327
	</td><td>
334
	</td><td>
328
	<fieldset>
335
	<fieldset>
329
	<legend><?php echo $conf["EXTIF"].$l_extif_legend; ?></legend>
336
	<legend><?php echo $conf["EXTIF"].$l_extif_legend; ?></legend>
330
	<table>
337
	<table>
331
		<?php
338
		<?php
332
		echo "<tr><td>".$l_ip_address." <input style='width:150px' type='text' name='ip_public' value=".$conf['PUBLIC_IP']."/></td></tr>";
339
		echo "<tr><td>".$l_ip_address." <input style='width:150px' type='text' name='ip_public' value=".$conf['PUBLIC_IP']."/></td></tr>";
333
		echo "<tr><td>".$l_ip_router." <input style='width:120px' type='text' name='ip_gw' value=".$conf['GW']."/></td></tr>";
340
		echo "<tr><td>".$l_ip_router." <input style='width:120px' type='text' name='ip_gw' value=".$conf['GW']."/></td></tr>";
334
		?>
341
		?>
335
	</table>
342
	</table>
336
	</fieldset>
343
	</fieldset>
337
	</td><td>
344
	</td><td>
338
	<fieldset>
345
	<fieldset>
339
	<legend><?php echo $conf["INTIF"].$l_intif_legend; ?></legend>
346
	<legend><?php echo $conf["INTIF"].$l_intif_legend; ?></legend>
340
	<table>
347
	<table>
341
	<?php
348
	<?php
342
	echo "<tr><td>".$l_ip_address."</td><td> <input style='width:150px' type='text' name='ip_private' value=".$conf['PRIVATE_IP']." /></td></tr>";
349
	echo "<tr><td>".$l_ip_address."</td><td> <input style='width:150px' type='text' name='ip_private' value=".$conf['PRIVATE_IP']." /></td></tr>";
343
	?>
350
	?>
344
	</table>
351
	</table>
345
	</fieldset>
352
	</fieldset>
346
	</td></tr>
353
	</td></tr>
347
	<tr><td colspan="3" align="center">
354
	<tr><td colspan="3" align="center">
348
	<?php echo "<input type='submit' value='$l_apply'>";?>
355
	<?php echo "<input type='submit' value='$l_apply'>";?>
349
	</td></tr>
356
	</td></tr>
350
</table>
357
</table>
351
</form>
358
</form>
352
<table width="100%" border="0" cellspacing="0" cellpadding="0">
359
<table width="100%" border="0" cellspacing="0" cellpadding="0">
353
	<tr><th><?php echo $l_dhcp_title;?></th></tr>
360
	<tr><th><?php echo $l_dhcp_title;?></th></tr>
354
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
361
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
355
</table>
362
</table>
356
<table width="100%" border=1 cellspacing=0 cellpadding=0>
363
<table width="100%" border=1 cellspacing=0 cellpadding=0>
357
<tr><td colspan="2" valign="middle" align="left">
364
<tr><td colspan="2" valign="middle" align="left">
358
<?
365
<?
359
$dhcp_state=trim($conf["DHCP"]);
366
$dhcp_state=trim($conf["DHCP"]);
360
echo "<CENTER><H3>$l_dhcp_state : ${"l_DHCP_".$dhcp_state}</H3></CENTER>";
367
echo "<CENTER><H3>$l_dhcp_state : ${"l_DHCP_".$dhcp_state}</H3></CENTER>";
361
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
368
echo "<FORM action='$_SERVER[PHP_SELF]' method=POST>";
362
echo "<select name='choix'>";
369
echo "<select name='choix'>";
363
echo "<option value=\"DHCP_Off\" ";if (!strcmp($dhcp_state,"off")) echo "selected";echo ">$l_DHCP_off";
370
echo "<option value=\"DHCP_Off\" ";if (!strcmp($dhcp_state,"off")) echo "selected";echo ">$l_DHCP_off";
364
echo "<option value=\"DHCP_On\" ";if (!strcmp($dhcp_state,"on")) echo "selected";echo ">$l_DHCP_on";
371
echo "<option value=\"DHCP_On\" ";if (!strcmp($dhcp_state,"on")) echo "selected";echo ">$l_DHCP_on";
365
echo "</select>";
372
echo "</select>";
366
echo "<input type=submit value='$l_apply'>";
373
echo "<input type=submit value='$l_apply'>";
367
echo "<br>$l_DHCP_off_explain";
374
echo "<br>$l_DHCP_off_explain";
368
 
375
 
369
echo "</FORM>";
376
echo "</FORM>";
370
echo "</td></tr>";
377
echo "</td></tr>";
371
if (strncmp($conf["DHCP"],"on",2) == 0) { require ('network2.php');}
378
if (strncmp($conf["DHCP"],"on",2) == 0) { require ('network2.php');}
372
else { echo "</TABLE>"; }
379
else { echo "</TABLE>"; }
373
$maxsize=100000;
380
$maxsize=100000;
374
?>
381
?>
375
 
382
 
376
<table width="100%" border="0" cellspacing="0" cellpadding="0">
383
<table width="100%" border="0" cellspacing="0" cellpadding="0">
377
	<tr><th><?php echo $l_local_dns;?></th></tr>
384
	<tr><th><?php echo $l_local_dns;?></th></tr>
378
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
385
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
379
</table>
386
</table>
380
<table width="100%" border="1" cellspacing="0" cellpadding="0">
387
<table width="100%" border="1" cellspacing="0" cellpadding="0">
381
<tr><td colspan=2 align="center">
388
<tr><td colspan=2 align="center">
382
<?
389
<?
383
echo "<FORM action='network.php' method='POST'>";
390
echo "<FORM action='network.php' method='POST'>";
384
echo "<table cellspacing=2 cellpadding=3 border=1>";
391
echo "<table cellspacing=2 cellpadding=3 border=1>";
385
echo "<tr><th>$l_host_name<th>$l_ip_address<th>$l_del</tr>";
392
echo "<tr><th>$l_host_name<th>$l_ip_address<th>$l_del</tr>";
386
// Read the "dns_local" file
393
// Read the "dns_local" file
387
$line_exist=False;
394
$line_exist=False;
388
$tab=file(DNS_LOCAL_FILE);
395
$tab=file(DNS_LOCAL_FILE);
389
if ($tab)  # not empty
396
if ($tab)  # not empty
390
	{
397
	{
391
	foreach ($tab as $line)
398
	foreach ($tab as $line)
392
		{
399
		{
393
			if (preg_match ('/^address/', $line))
400
			if (preg_match ('/^address/', $line))
394
			{
401
			{
395
				$line_exist=True;
402
				$line_exist=True;
396
				$field=explode("/", $line);
403
				$field=explode("/", $line);
397
				$host_name=$field[1];
404
				$host_name=$field[1];
398
				$ip_addr=$field[2];
405
				$ip_addr=$field[2];
399
				echo "<tr><td>$host_name";
406
				echo "<tr><td>$host_name";
400
				echo "<td>$ip_addr";
407
				echo "<td>$ip_addr";
401
				echo "<td><input type='checkbox' name='$host_name'>";
408
				echo "<td><input type='checkbox' name='$host_name'>";
402
				echo "</tr>";
409
				echo "</tr>";
403
			}
410
			}
404
		}
411
		}
405
	}
412
	}
406
echo "</table>";
413
echo "</table>";
407
if ($line_exist)
414
if ($line_exist)
408
	{
415
	{
409
	echo "<input type='hidden' name='choix' value='del_host'>";
416
	echo "<input type='hidden' name='choix' value='del_host'>";
410
	echo "<input type='submit' value='$l_apply'>";
417
	echo "<input type='submit' value='$l_apply'>";
411
	}	
418
	}	
412
echo "</form></td><td valign='middle' align='center'>";
419
echo "</form></td><td valign='middle' align='center'>";
413
echo "<FORM name='new_host' action='network.php' method='POST'>";
420
echo "<FORM name='new_host' action='network.php' method='POST'>";
414
echo "<table cellspacing=2 cellpadding=3 border=1>";
421
echo "<table cellspacing=2 cellpadding=3 border=1>";
415
echo "<tr><th>$l_host_name<th>$l_ip_address";
422
echo "<tr><th>$l_host_name<th>$l_ip_address";
416
?>
423
?>
417
<td></td></tr>
424
<td></td></tr>
418
<tr><td>Ex. : my_nas</td><td>Ex. : 192.168.182.10</td><td></td></tr>
425
<tr><td>Ex. : my_nas</td><td>Ex. : 192.168.182.10</td><td></td></tr>
419
<tr><td><input type='text' name='add_host' size='17'></td>
426
<tr><td><input type='text' name='add_host' size='17'></td>
420
<td><input type='text' name='add_ip' size='10'><input type='hidden' name='choix' value='new_host'></td>
427
<td><input type='text' name='add_ip' size='10'><input type='hidden' name='choix' value='new_host'></td>
421
<td><? echo "<input type=submit class=button value=\"$l_add_to_list\">"?></td>
428
<td><? echo "<input type=submit class=button value=\"$l_add_to_list\">"?></td>
422
</tr></table>
429
</tr></table>
423
</form>
430
</form>
424
</td></tr>
431
</td></tr>
425
</table>
432
</table>
426
<table width="100%" border="0" cellspacing="0" cellpadding="0">
433
<table width="100%" border="0" cellspacing="0" cellpadding="0">
427
	<tr><th><?php echo $l_import_cert;?></th></tr>
434
	<tr><th><?php echo $l_import_cert;?></th></tr>
428
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
435
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" height="2"></td></tr>
429
</table>
436
</table>
430
<table width="100%" border="1" cellspacing="0" cellpadding="0">
437
<table width="100%" border="1" cellspacing="0" cellpadding="0">
431
	<tr><td>
438
	<tr><td>
432
	<form method="post" action="network.php" enctype="multipart/form-data">
439
	<form method="post" action="network.php" enctype="multipart/form-data">
433
	<?php echo $l_private_key;?><input type="file" name="key"><br>
440
	<?php echo $l_private_key;?><input type="file" name="key"><br>
434
	<?php echo $l_certificate;?><input type="file" name="crt"><br>
441
	<?php echo $l_certificate;?><input type="file" name="crt"><br>
435
	<?php echo $l_server_chain;?><input type="file" name="sc">
442
	<?php echo $l_server_chain;?><input type="file" name="sc">
436
	<input type="hidden" name="MAX_FILE_SIZE" value=<?php echo $maxsize;?>><br>
443
	<input type="hidden" name="MAX_FILE_SIZE" value=<?php echo $maxsize;?>><br>
437
	<input type="submit" <?php echo "value=\"".$l_import."\""?>>
444
	<input type="submit" <?php echo "value=\"".$l_import."\""?>>
438
	</form>
445
	</form>
439
<?php
446
<?php
440
$cert_subject = exec("/bin/openssl x509 -noout -subject -in /etc/pki/tls/certs/alcasar.crt");
447
$cert_subject = exec("/bin/openssl x509 -noout -subject -in /etc/pki/tls/certs/alcasar.crt");
441
$cert_issuer = exec("/bin/openssl x509 -noout -issuer -in /etc/pki/tls/certs/alcasar.crt");
448
$cert_issuer = exec("/bin/openssl x509 -noout -issuer -in /etc/pki/tls/certs/alcasar.crt");
442
$cert_expiration_date = exec("/bin/openssl x509 -noout -dates -in /etc/pki/tls/certs/alcasar.crt|grep After|cut -d\"=\" -f2");
449
$cert_expiration_date = exec("/bin/openssl x509 -noout -dates -in /etc/pki/tls/certs/alcasar.crt|grep After|cut -d\"=\" -f2");
443
$domain = exec("echo $cert_subject | sed -n '/^subject/s/^.*CN=//p' | cut -d'/' -f 1");
450
$domain = exec("echo $cert_subject | sed -n '/^subject/s/^.*CN=//p' | cut -d'/' -f 1");
444
$organization = exec("echo $cert_subject | sed -n '/^subject/s/^.*O=//p' | cut -d'/' -f 1");
451
$organization = exec("echo $cert_subject | sed -n '/^subject/s/^.*O=//p' | cut -d'/' -f 1");
445
$CAdomain = exec("echo $cert_issuer | sed -n '/^issuer/s/^.*CN=//p' | cut -d'/' -f 1");
452
$CAdomain = exec("echo $cert_issuer | sed -n '/^issuer/s/^.*CN=//p' | cut -d'/' -f 1");
446
$CAorganization = exec("echo $cert_issuer | sed -n '/^issuer/s/^.*O=//p' | cut -d'/' -f 1");
453
$CAorganization = exec("echo $cert_issuer | sed -n '/^issuer/s/^.*O=//p' | cut -d'/' -f 1");
447
 
454
 
448
	echo "<br>";
455
	echo "<br>";
449
	echo "<h3>".$l_current_certificate."</h3>";
456
	echo "<h3>".$l_current_certificate."</h3>";
450
	echo "Expiration Date : ".$cert_expiration_date."<br>";
457
	echo "Expiration Date : ".$cert_expiration_date."<br>";
451
	echo "Common name : ".$domain."<br>";
458
	echo "Common name : ".$domain."<br>";
452
	echo "Organization : ".$organization."<br/>";
459
	echo "Organization : ".$organization."<br/>";
453
	echo "<h4>". $l_validated ."</h4>";
460
	echo "<h4>". $l_validated ."</h4>";
454
	echo "Common name : ".$CAdomain."<br>";
461
	echo "Common name : ".$CAdomain."<br>";
455
	echo "Organization : ".$CAorganization."<br>";
462
	echo "Organization : ".$CAorganization."<br>";
456
?>
463
?>
457
	</td><td>
464
	</td><td>
458
	<form method="post" action="network.php">
465
	<form method="post" action="network.php">
459
	<input type="hidden" name="default">
466
	<input type="hidden" name="default">
460
	<input type="submit" <?php echo "value=\"".$l_default_cert."\""; if(!file_exists("/etc/pki/tls/certs/alcasar.crt.old") || !file_exists("/etc/pki/tls/private/alcasar.key.old")){ echo " disabled";}?>>
467
	<input type="submit" <?php echo "value=\"".$l_default_cert."\""; if(!file_exists("/etc/pki/tls/certs/alcasar.crt.old") || !file_exists("/etc/pki/tls/private/alcasar.key.old")){ echo " disabled";}?>>
461
	</form>
468
	</form>
462
	</td>
469
	</td>
463
	</tr>
470
	</tr>
464
</table>
471
</table>
465
</body>
472
</body>
466
</html>
473
</html>
467
 
474
 
468
<?php
475
<?php
469
if(isset($_POST['default'])){
476
if(isset($_POST['default'])){
470
	echo "$l_default_cert";
477
	echo "$l_default_cert";
471
	exec("sudo alcasar-importcert.sh -d");
478
	exec("sudo alcasar-importcert.sh -d");
472
}
479
}
473
if(isset($_POST['MAX_FILE_SIZE'])){
480
if(isset($_POST['MAX_FILE_SIZE'])){
474
	echo "changement";
481
	echo "changement";
475
	$maxsize = 100000;
482
	$maxsize = 100000;
476
	if(isset($_FILES['key']) && isset($_FILES['crt']) && $_FILES['key']['error'] == 0 && $_FILES['crt']['error'] == 0){
483
	if(isset($_FILES['key']) && isset($_FILES['crt']) && $_FILES['key']['error'] == 0 && $_FILES['crt']['error'] == 0){
477
		$dest = "/tmp/";
484
		$dest = "/tmp/";
478
		if($_FILES['key']['size'] <= $maxsize && $_FILES['crt']['size'] <= $maxsize)
485
		if($_FILES['key']['size'] <= $maxsize && $_FILES['crt']['size'] <= $maxsize)
479
		{
486
		{
480
			if(pathinfo($_FILES['key']['name'])['extension'] == 'key' && pathinfo($_FILES['crt']['name'])['extension'] == 'crt')
487
			if(pathinfo($_FILES['key']['name'])['extension'] == 'key' && pathinfo($_FILES['crt']['name'])['extension'] == 'crt')
481
			{
488
			{
482
				$scpath = "";
489
				$scpath = "";
483
				if(isset($_FILES['sc']) && pathinfo($_FILES['sc']['name'])['extension'] == 'crt')
490
				if(isset($_FILES['sc']) && pathinfo($_FILES['sc']['name'])['extension'] == 'crt')
484
				{
491
				{
485
					$scpath = $dest."server-chain.crt";
492
					$scpath = $dest."server-chain.crt";
486
					move_uploaded_file($_FILES['sc']['tmp_name'], $scpath);
493
					move_uploaded_file($_FILES['sc']['tmp_name'], $scpath);
487
				}
494
				}
488
				$keypath = $dest."alcasar.key";
495
				$keypath = $dest."alcasar.key";
489
				$crtpath = $dest."alcasar.crt";
496
				$crtpath = $dest."alcasar.crt";
490
				move_uploaded_file($_FILES['key']['tmp_name'], $keypath);
497
				move_uploaded_file($_FILES['key']['tmp_name'], $keypath);
491
				move_uploaded_file($_FILES['crt']['tmp_name'], $crtpath);
498
				move_uploaded_file($_FILES['crt']['tmp_name'], $crtpath);
492
				exec("sudo alcasar-importcert.sh -i $crtpath -k $keypath -c $scpath");
499
				exec("sudo alcasar-importcert.sh -i $crtpath -k $keypath -c $scpath");
493
			}
500
			}
494
		}
501
		}
495
	}
502
	}
496
}
503
}
497
?>
504
?>
498
 
505
 
499
 
506