Revision 51a14c58
Added by Phil Davis over 9 years ago
src/etc/inc/upgrade_config.inc | ||
---|---|---|
3999 | 3999 |
if (!function_exists("file_notice")) { |
4000 | 4000 |
require_once("notices.inc"); |
4001 | 4001 |
} |
4002 |
file_notice("WirelessSettings", "WEP is no longer supported. It will be disabled on the {$ifname} interface and the interface will be disabled. Please reconfigure the interface.");
|
|
4002 |
file_notice("WirelessSettings", sprintf(gettext("WEP is no longer supported. It will be disabled on the %s interface and the interface will be disabled. Please reconfigure the interface."), $ifname));
|
|
4003 | 4003 |
unset($config['interfaces'][$ifname]['wireless']['wep']); |
4004 | 4004 |
if (isset($intf['enable'])) { |
4005 | 4005 |
unset($config['interfaces'][$ifname]['enable']); |
... | ... | |
4209 | 4209 |
$p1['encryption-algorithm']['name'] == 'des') { |
4210 | 4210 |
$p1['disabled'] = true; |
4211 | 4211 |
file_notice("IPsec", |
4212 |
"DES is no longer supported, IPsec phase 1 " . |
|
4213 |
"item '{$p1['descr']}' is being disabled."); |
|
4212 |
sprintf(gettext("DES is no longer supported, IPsec phase 1 item '%s' is being disabled."), $p1['descr'])); |
|
4214 | 4213 |
} |
4215 | 4214 |
} |
4216 | 4215 |
} |
... | ... | |
4227 | 4226 |
if ($ealgo['name'] == 'des') { |
4228 | 4227 |
$p2['disabled'] = true; |
4229 | 4228 |
file_notice("IPsec", |
4230 |
"DES is no longer supported, IPsec phase 2 " . |
|
4231 |
"item '{$p2['descr']}' is being disabled."); |
|
4229 |
sprintf(gettext("DES is no longer supported, IPsec phase 2 item '%s' is being disabled."), $p2['descr'])); |
|
4232 | 4230 |
} |
4233 | 4231 |
} |
4234 | 4232 |
} |
... | ... | |
4273 | 4271 |
global $config; |
4274 | 4272 |
|
4275 | 4273 |
if (isset($config['l7shaper'])) { |
4276 |
file_notice("L7shaper", "Layer 7 shaping is no longer supported. Its configuration has been removed.");
|
|
4274 |
file_notice("L7shaper", gettext("Layer 7 shaping is no longer supported. Its configuration has been removed."));
|
|
4277 | 4275 |
unset($config['l7shaper']); |
4278 | 4276 |
if (is_array($config['filter']['rule'])) { |
4279 | 4277 |
foreach ($config['filter']['rule'] as $idx => $rule) { |
src/etc/inc/util.inc | ||
---|---|---|
277 | 277 |
refcount_init($reference); |
278 | 278 |
$shmid = @shmop_open($reference, "w", 0, 0); |
279 | 279 |
if (!$shmid) { |
280 |
log_error(gettext("Could not open shared memory {$reference}"));
|
|
280 |
log_error(sprintf(gettext("Could not open shared memory %s"), $reference));
|
|
281 | 281 |
unlock($shm_lck); |
282 | 282 |
return; |
283 | 283 |
} |
... | ... | |
302 | 302 |
$shmid = @shmop_open($reference, "w", 0, 0); |
303 | 303 |
if (!$shmid) { |
304 | 304 |
refcount_init($reference); |
305 |
log_error(gettext("Could not open shared memory {$reference}"));
|
|
305 |
log_error(sprintf(gettext("Could not open shared memory %s"), $reference));
|
|
306 | 306 |
unlock($shm_lck); |
307 | 307 |
return; |
308 | 308 |
} |
... | ... | |
329 | 329 |
/* There is no need for locking. */ |
330 | 330 |
$shmid = @shmop_open($reference, "a", 0, 0); |
331 | 331 |
if (!$shmid) { |
332 |
log_error(gettext("Could not open shared memory for read {$reference}"));
|
|
332 |
log_error(sprintf(gettext("Could not open shared memory for read %s"), $reference));
|
|
333 | 333 |
return -1; |
334 | 334 |
} |
335 | 335 |
$shm_data = @shmop_read($shmid, 0, 10); |
src/etc/inc/voucher.inc | ||
---|---|---|
93 | 93 |
XML_RPC_encode($execcmd) |
94 | 94 |
); |
95 | 95 |
|
96 |
log_error("Captive Portal Voucher XMLRPC sync data {$url}:{$port}.");
|
|
96 |
log_error(sprintf(gettext("Captive Portal Voucher XMLRPC sync data %s."), $url . ":" . $port));
|
|
97 | 97 |
$msg = new XML_RPC_Message($method, $params); |
98 | 98 |
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); |
99 | 99 |
$cli->setCredentials($username, $password); |
100 | 100 |
$resp = $cli->send($msg, "250"); |
101 | 101 |
if (!is_object($resp)) { |
102 |
$error = "A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
|
|
102 |
$error = sprintf(gettext("A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with %s (pfsense.exec_php)."), $url . ":" . $port);
|
|
103 | 103 |
log_error($error); |
104 | 104 |
file_notice("CaptivePortalVoucherSync", $error, "Communications error occurred", ""); |
105 | 105 |
return false; |
106 | 106 |
} elseif ($resp->faultCode()) { |
107 |
$error = "An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
|
|
107 |
$error = sprintf(gettext('An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with %1$s - Code %2$s'), $url . ":" . $port, $resp->faultCode() . ": " . $resp->faultString());
|
|
108 | 108 |
log_error($error); |
109 | 109 |
file_notice("CaptivePortalVoucherSync", $error, "Error code received", ""); |
110 | 110 |
return false; |
111 | 111 |
} else { |
112 |
log_error("CaptivePortalVoucherSync XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
|
|
112 |
log_error(sprintf(gettext("CaptivePortalVoucherSync XMLRPC reload data success with %s (pfsense.exec_php)."), $url . ":" . $port));
|
|
113 | 113 |
} |
114 | 114 |
|
115 | 115 |
$toreturn = XML_RPC_Decode($resp->value()); |
... | ... | |
153 | 153 |
XML_RPC_encode($execcmd) |
154 | 154 |
); |
155 | 155 |
|
156 |
log_error("Captive Portal Voucher XMLRPC sync data {$url}:{$port}.");
|
|
156 |
log_error(sprintf(gettext("Captive Portal Voucher XMLRPC sync data %s."), $url . ":" . $port));
|
|
157 | 157 |
$msg = new XML_RPC_Message($method, $params); |
158 | 158 |
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); |
159 | 159 |
$cli->setCredentials($username, $password); |
160 | 160 |
$resp = $cli->send($msg, "250"); |
161 | 161 |
if (!is_object($resp)) { |
162 |
$error = "A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
|
|
162 |
$error = sprintf(gettext("A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with %s (pfsense.exec_php)."), $url . ":" . $port);
|
|
163 | 163 |
log_error($error); |
164 | 164 |
file_notice("CaptivePortalVoucherSync", $error, "Communications error occurred", ""); |
165 | 165 |
return false; |
166 | 166 |
} elseif ($resp->faultCode()) { |
167 |
$error = "An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
|
|
167 |
$error = sprintf(gettext('An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with %1$s - Code %2$s'), $url . ":" . $port, $resp->faultCode() . ": " . $resp->faultString());
|
|
168 | 168 |
log_error($error); |
169 | 169 |
file_notice("CaptivePortalVoucherSync", $error, "Error code received", ""); |
170 | 170 |
return false; |
171 | 171 |
} else { |
172 |
log_error("CaptivePortalVoucherSync XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
|
|
172 |
log_error(sprintf(gettext("CaptivePortalVoucherSync XMLRPC reload data success with %s (pfsense.exec_php)."), $url . ":" . $port));
|
|
173 | 173 |
} |
174 | 174 |
|
175 | 175 |
$toreturn = XML_RPC_Decode($resp->value()); |
... | ... | |
212 | 212 |
XML_RPC_encode($execcmd) |
213 | 213 |
); |
214 | 214 |
|
215 |
log_error("Captive Portal Voucher XMLRPC sync data {$url}:{$port}.");
|
|
215 |
log_error(sprintf(gettext("Captive Portal Voucher XMLRPC sync data %s."), $url . ":" . $port));
|
|
216 | 216 |
$msg = new XML_RPC_Message($method, $params); |
217 | 217 |
$cli = new XML_RPC_Client('/xmlrpc.php', $url, $port); |
218 | 218 |
$cli->setCredentials($username, $password); |
219 | 219 |
$resp = $cli->send($msg, "250"); |
220 | 220 |
if (!is_object($resp)) { |
221 |
$error = "A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} (pfsense.exec_php).";
|
|
221 |
$error = sprintf(gettext("A communications error occurred while attempting CaptivePortalVoucherSync XMLRPC sync with %s (pfsense.exec_php)."), $url . ":" . $port);
|
|
222 | 222 |
log_error($error); |
223 | 223 |
file_notice("CaptivePortalVoucherSync", $error, "Communications error occurred", ""); |
224 | 224 |
return null; // $timeleft |
225 | 225 |
} elseif ($resp->faultCode()) { |
226 |
$error = "An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with {$url}:{$port} - Code " . $resp->faultCode() . ": " . $resp->faultString();
|
|
226 |
$error = sprintf(gettext('An error code was received while attempting CaptivePortalVoucherSync XMLRPC sync with %1$s - Code %2$s'), $url . ":" . $port, $resp->faultCode() . ": " . $resp->faultString());
|
|
227 | 227 |
log_error($error); |
228 | 228 |
file_notice("CaptivePortalVoucherSync", $error, "Error code received", ""); |
229 | 229 |
return null; // $timeleft |
230 | 230 |
} else { |
231 |
log_error("CaptivePortalVoucherSync XMLRPC reload data success with {$url}:{$port} (pfsense.exec_php).");
|
|
231 |
log_error(sprintf(gettext("CaptivePortalVoucherSync XMLRPC reload data success with %s (pfsense.exec_php)."), $url . ":" . $port));
|
|
232 | 232 |
} |
233 | 233 |
$toreturn = XML_RPC_Decode($resp->value()); |
234 | 234 |
if (!is_array($config['voucher'])) { |
... | ... | |
237 | 237 |
|
238 | 238 |
if (is_array($toreturn['voucher']) && is_array($toreturn['voucher']['roll'])) { |
239 | 239 |
$config['voucher'][$cpzone]['roll'] = $toreturn['voucher']['roll']; |
240 |
write_config("Captive Portal Voucher database synchronized with {$url}");
|
|
240 |
write_config(sprintf(gettext("Captive Portal Voucher database synchronized with %s"), $url));
|
|
241 | 241 |
voucher_configure_zone(true); |
242 | 242 |
unset($toreturn['voucher']); |
243 | 243 |
} else if (!isset($toreturn['timeleft'])) { |
... | ... | |
324 | 324 |
$unsetindexes[] = $cpentry[5]; |
325 | 325 |
} |
326 | 326 |
} else { |
327 |
captiveportal_syslog("$voucher ($roll/$nr): not found on any registered Roll");
|
|
327 |
captiveportal_syslog(sprintf(gettext('%1$s (%2$s/%3$s): not found on any registered Roll'), $voucher, $roll, $nr));
|
|
328 | 328 |
} |
329 | 329 |
} else { |
330 | 330 |
// hmm, thats weird ... not what I expected |
331 |
captiveportal_syslog("$voucher invalid: {$output[0]}!!");
|
|
331 |
captiveportal_syslog(sprintf(gettext('%1$s invalid: %2$s!!'), $voucher, $output[0]));
|
|
332 | 332 |
} |
333 | 333 |
} |
334 | 334 |
|
... | ... | |
415 | 415 |
foreach ($a_vouchers_received as $voucher) { |
416 | 416 |
$v = escapeshellarg($voucher); |
417 | 417 |
if (strlen($voucher) < 5) { |
418 |
$test_result[] = "{$voucher} invalid: Too short!"; |
|
419 |
captiveportal_syslog("{$voucher} invalid: Too short!"); |
|
418 |
$voucher_err_text = sprintf(gettext("%s invalid: Too short!"), $voucher); |
|
419 |
$test_result[] = $voucher_err_text; |
|
420 |
captiveportal_syslog($voucher_err_text); |
|
420 | 421 |
$error++; |
421 | 422 |
continue; // seems too short to be a voucher! |
422 | 423 |
} |
... | ... | |
452 | 453 |
$pos = $nr >> 3; // divide by 8 -> octet |
453 | 454 |
$mask = 1 << ($nr % 8); |
454 | 455 |
if (ord($bitstring[$roll][$pos]) & $mask) { |
455 |
$test_result[] = "$voucher ($roll/$nr) already used and expired"; |
|
456 |
captiveportal_syslog("$voucher ($roll/$nr) already used and expired"); |
|
456 |
$voucher_err_text = sprintf(gettext('%1$s (%2$s/%3$s) already used and expired'), $voucher, $roll, $nr); |
|
457 |
$test_result[] = $voucher_err_text; |
|
458 |
captiveportal_syslog($voucher_err_text); |
|
457 | 459 |
$total_minutes = -1; // voucher expired |
458 | 460 |
$error++; |
459 | 461 |
} else { |
460 | 462 |
// mark bit for this voucher as used |
461 | 463 |
$bitstring[$roll][$pos] = chr(ord($bitstring[$roll][$pos]) | $mask); |
462 |
$test_result[] = "$voucher ($roll/$nr) good for {$minutes_per_roll[$roll]} Minutes";
|
|
464 |
$test_result[] = sprintf(gettext('%1$s (%2$s/%3$s) good for %4$s Minutes'), $voucher, $roll, $nr, $minutes_per_roll[$roll]);
|
|
463 | 465 |
$total_minutes += $minutes_per_roll[$roll]; |
464 | 466 |
} |
465 | 467 |
} |
466 | 468 |
} else { |
467 |
$test_result[] = "$voucher ($roll/$nr): not found on any registered Roll"; |
|
468 |
captiveportal_syslog("$voucher ($roll/$nr): not found on any registered Roll"); |
|
469 |
$voucher_err_text = sprintf(gettext('%1$s (%2$s/%3$s): not found on any registered Roll'), $voucher, $roll, $nr); |
|
470 |
$test_result[] = $voucher_err_text; |
|
471 |
captiveportal_syslog($voucher_err_text); |
|
469 | 472 |
} |
470 | 473 |
} else { |
471 | 474 |
// hmm, thats weird ... not what I expected |
472 |
$test_result[] = "$voucher invalid: $result !!"; |
|
473 |
captiveportal_syslog("$voucher invalid: $result !!"); |
|
475 |
$voucher_err_text = sprintf(gettext('%1$s invalid: %2$s !!'), $voucher, $result); |
|
476 |
$test_result[] = $voucher_err_text; |
|
477 |
captiveportal_syslog($voucher_err_text); |
|
474 | 478 |
$error++; |
475 | 479 |
} |
476 | 480 |
} |
... | ... | |
647 | 651 |
fwrite($fd, $vdb . "\n"); |
648 | 652 |
fclose($fd); |
649 | 653 |
} else { |
650 |
voucher_log(LOG_ERR, sprintf(gettext('cant write %1$s/voucher_%s_used_%2$s.db'), $g['vardb_path'], $cpzone, $roll));
|
|
654 |
voucher_log(LOG_ERR, sprintf(gettext('cant write %1$s/voucher_%2$s_used_%3$s.db'), $g['vardb_path'], $cpzone, $roll));
|
|
651 | 655 |
} |
652 | 656 |
} |
653 | 657 |
|
... | ... | |
733 | 737 |
$vdb = trim(fgets($fd)); |
734 | 738 |
fclose($fd); |
735 | 739 |
} else { |
736 |
voucher_log(LOG_ERR, sprintf(gettext('cant read %1$s/voucher_%s_used_%2$s.db'), $g['vardb_path'], $cpzone, $roll));
|
|
740 |
voucher_log(LOG_ERR, sprintf(gettext('cant read %1$s/voucher_%2$s_used_%3$s.db'), $g['vardb_path'], $cpzone, $roll));
|
|
737 | 741 |
} |
738 | 742 |
} |
739 | 743 |
return base64_decode($vdb); |
... | ... | |
805 | 809 |
|
806 | 810 |
unlock($voucherlck); |
807 | 811 |
|
808 |
write_config("Syncing vouchers");
|
|
812 |
write_config(gettext("Syncing vouchers"));
|
|
809 | 813 |
return; |
810 | 814 |
} |
811 | 815 |
|
src/etc/inc/vpn.inc | ||
---|---|---|
91 | 91 |
/* include all configuration functions */ |
92 | 92 |
function vpn_ipsec_convert_to_modp($index) { |
93 | 93 |
|
94 |
$convertion = "";
|
|
94 |
$conversion = "";
|
|
95 | 95 |
switch ($index) { |
96 | 96 |
case '1': |
97 |
$convertion = "modp768";
|
|
97 |
$conversion = "modp768";
|
|
98 | 98 |
break; |
99 | 99 |
case '2': |
100 |
$convertion = "modp1024";
|
|
100 |
$conversion = "modp1024";
|
|
101 | 101 |
break; |
102 | 102 |
case '5': |
103 |
$convertion = "modp1536";
|
|
103 |
$conversion = "modp1536";
|
|
104 | 104 |
break; |
105 | 105 |
case '14': |
106 |
$convertion = "modp2048";
|
|
106 |
$conversion = "modp2048";
|
|
107 | 107 |
break; |
108 | 108 |
case '15': |
109 |
$convertion = "modp3072";
|
|
109 |
$conversion = "modp3072";
|
|
110 | 110 |
break; |
111 | 111 |
case '16': |
112 |
$convertion = "modp4096";
|
|
112 |
$conversion = "modp4096";
|
|
113 | 113 |
break; |
114 | 114 |
case '17': |
115 |
$convertion = "modp6144";
|
|
115 |
$conversion = "modp6144";
|
|
116 | 116 |
break; |
117 | 117 |
case '18': |
118 |
$convertion = "modp8192";
|
|
118 |
$conversion = "modp8192";
|
|
119 | 119 |
break; |
120 | 120 |
case '19': |
121 |
$convertion = "ecp256";
|
|
121 |
$conversion = "ecp256";
|
|
122 | 122 |
break; |
123 | 123 |
case '20': |
124 |
$convertion = "ecp384";
|
|
124 |
$conversion = "ecp384";
|
|
125 | 125 |
break; |
126 | 126 |
case '21': |
127 |
$convertion = "ecp521";
|
|
127 |
$conversion = "ecp521";
|
|
128 | 128 |
break; |
129 | 129 |
case '22': |
130 |
$convertion = "modp1024s160";
|
|
130 |
$conversion = "modp1024s160";
|
|
131 | 131 |
break; |
132 | 132 |
case '23': |
133 |
$convertion = "modp2048s224";
|
|
133 |
$conversion = "modp2048s224";
|
|
134 | 134 |
break; |
135 | 135 |
case '24': |
136 |
$convertion = "modp2048s256";
|
|
136 |
$conversion = "modp2048s256";
|
|
137 | 137 |
break; |
138 | 138 |
case '28': |
139 |
$convertion = "ecp256bp";
|
|
139 |
$conversion = "ecp256bp";
|
|
140 | 140 |
break; |
141 | 141 |
case '29': |
142 |
$convertion = "ecp384bp";
|
|
142 |
$conversion = "ecp384bp";
|
|
143 | 143 |
break; |
144 | 144 |
case '30': |
145 |
$convertion = "ecp512bp";
|
|
145 |
$conversion = "ecp512bp";
|
|
146 | 146 |
break; |
147 | 147 |
} |
148 | 148 |
|
149 |
return $convertion;
|
|
149 |
return $conversion;
|
|
150 | 150 |
} |
151 | 151 |
|
152 | 152 |
function vpn_ipsec_configure($restart = false) { |
... | ... | |
309 | 309 |
|
310 | 310 |
$ep = ipsec_get_phase1_src($ph1ent); |
311 | 311 |
if (!is_ipaddr($ep)) { |
312 |
log_error("IPsec ERROR: Could not find phase 1 source for connection {$ph1ent['descr']}. Omitting from configuration file.");
|
|
312 |
log_error(sprintf(gettext("IPsec ERROR: Could not find phase 1 source for connection %s. Omitting from configuration file."), $ph1ent['descr']));
|
|
313 | 313 |
continue; |
314 | 314 |
} |
315 | 315 |
|
... | ... | |
338 | 338 |
} |
339 | 339 |
} |
340 | 340 |
if (array_search($rg, $rgmap)) { |
341 |
log_error("The remote gateway {$rg} already exists on another phase 1 entry");
|
|
341 |
log_error(sprintf(gettext("The remote gateway %s already exists on another phase 1 entry"), $rg));
|
|
342 | 342 |
continue; |
343 | 343 |
} |
344 | 344 |
$rgmap[$ph1ent['remote-gateway']] = $rg; |
... | ... | |
1403 | 1403 |
$ipsecfin .= "\tleftsubnet = " . $leftsubnet_spec[$idx] . "\n"; |
1404 | 1404 |
} |
1405 | 1405 |
} else { |
1406 |
log_error("No phase2 specifications for tunnel with REQID = {$ikeid}");
|
|
1406 |
log_error(sprintf(gettext("No phase2 specifications for tunnel with REQID = %s"), $ikeid));
|
|
1407 | 1407 |
} |
1408 | 1408 |
} else { |
1409 | 1409 |
$ipsecfin = "\nconn con{$ph1ent['ikeid']}\n"; |
src/etc/inc/xmlrpc.inc | ||
---|---|---|
119 | 119 |
|
120 | 120 |
array_shift($params); |
121 | 121 |
unset($params['xmlrpcauth']); |
122 |
log_error("webConfigurator authentication error for 'admin' from {$_SERVER['REMOTE_ADDR']} during sync settings.");
|
|
122 |
log_error(sprintf(gettext("webConfigurator authentication error for 'admin' from %s during sync settings."), $_SERVER['REMOTE_ADDR']));
|
|
123 | 123 |
return false; |
124 | 124 |
} |
125 | 125 |
|
Also available in: Unified diff
Internationalize etc inc uvx