diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php index f6c4577dd4..c6cf3e9a0b 100644 --- a/usr/local/www/services_captiveportal_vouchers.php +++ b/usr/local/www/services_captiveportal_vouchers.php @@ -36,7 +36,6 @@ ##|*MATCH=services_captiveportal_vouchers.php* ##|-PRIV -$pgtitle = array("Services", "Captive portal", "Vouchers"); $statusurl = "status_captiveportal_vouchers.php"; $logurl = "diag_logs_auth.php"; @@ -47,6 +46,8 @@ require("shaper.inc"); require("captiveportal.inc"); require_once("voucher.inc"); +$pgtitle = array(gettext("Services"), gettext("Captive portal"), gettext("Vouchers")); + if (!is_array($config['voucher'])) { $config['voucher'] = array(); } @@ -87,10 +88,10 @@ if (!isset($config['voucher']['publickey'])) { } } if (!isset($config['voucher']['msgnoaccess'])) { - $config['voucher']['msgnoaccess'] = "Voucher invalid"; + $config['voucher']['msgnoaccess'] = gettext("Voucher invalid"); } if (!isset($config['voucher']['msgexpired'])) { - $config['voucher']['msgexpired'] = "Voucher expired"; + $config['voucher']['msgexpired'] = gettext("Voucher expired"); } $a_roll = &$config['voucher']['roll']; @@ -115,7 +116,7 @@ if ($_GET['act'] == "csv") { if (strstr($privkey,"BEGIN RSA PRIVATE KEY")) { $fd = fopen("{$g['varetc_path']}/voucher.private","w"); if (!$fd) { - $input_errors[] = "Cannot write private key file.\n"; + $input_errors[] = gettext("Cannot write private key file") . ".\n"; } else { chmod("{$g['varetc_path']}/voucher.private", 0600); fwrite($fd, $privkey); @@ -135,7 +136,7 @@ if ($_GET['act'] == "csv") { } } } else { - $input_errors[] = "Need private RSA key to print vouchers\n"; + $input_errors[] = gettext("Need private RSA key to print vouchers") . "\n"; } } @@ -159,37 +160,37 @@ if ($_POST) { /* input validation */ if ($_POST['enable']) { $reqdfields = explode(" ", "charset rollbits ticketbits checksumbits publickey magic saveinterval"); - $reqdfieldsn = explode(",", "charset,rollbits,ticketbits,checksumbits,publickey,magic,saveinterval"); + $reqdfieldsn = array(gettext("charset"),gettext("rollbits"),gettext("ticketbits"),gettext("checksumbits"),gettext("publickey"),gettext("magic"),gettext("saveinterval")); do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); } if ($_POST['charset'] && (strlen($_POST['charset'] < 2))) { - $input_errors[] = "Need at least 2 characters to create vouchers."; + $input_errors[] = gettext("Need at least 2 characters to create vouchers."); } if ($_POST['charset'] && (strpos($_POST['charset'],"\"")>0)) { - $input_errors[] = "Double quotes aren't allowed."; + $input_errors[] = gettext("Double quotes aren't allowed."); } if ($_POST['charset'] && (strpos($_POST['charset'],",")>0)) { - $input_errors[] = "',' aren't allowed."; + $input_errors[] = "',' " . gettext("aren't allowed."); } if ($_POST['rollbits'] && (!is_numeric($_POST['rollbits']) || ($_POST['rollbits'] < 1) || ($_POST['rollbits'] > 31))) { - $input_errors[] = "# of Bits to store Roll Id needs to be between 1..31."; + $input_errors[] = gettext("# of Bits to store Roll Id needs to be between 1..31."); } if ($_POST['ticketbits'] && (!is_numeric($_POST['ticketbits']) || ($_POST['ticketbits'] < 1) || ($_POST['ticketbits'] > 16))) { - $input_errors[] = "# of Bits to store Ticket Id needs to be between 1..16."; + $input_errors[] = gettext("# of Bits to store Ticket Id needs to be between 1..16."); } if ($_POST['checksumbits'] && (!is_numeric($_POST['checksumbits']) || ($_POST['checksumbits'] < 1) || ($_POST['checksumbits'] > 31))) { - $input_errors[] = "# of Bits to store checksum needs to be between 1..31."; + $input_errors[] = gettext("# of Bits to store checksum needs to be between 1..31."); } if ($_POST['saveinterval'] && (!is_numeric($_POST['saveinterval']) || ($_POST['saveinterval'] < 1))) { - $input_errors[] = "Save interval in minutes cant be negative."; + $input_errors[] = gettext("Save interval in minutes cant be negative."); } if ($_POST['publickey'] && (!strstr($_POST['publickey'],"BEGIN PUBLIC KEY"))) { - $input_errors[] = "This doesn't look like an RSA Public key."; + $input_errors[] = gettext("This doesn't look like an RSA Public key."); } if ($_POST['privatekey'] && (!strstr($_POST['privatekey'],"BEGIN RSA PRIVATE KEY"))) { - $input_errors[] = "This doesn't look like an RSA Private key."; + $input_errors[] = gettext("This doesn't look like an RSA Private key."); } if (!$input_errors) { @@ -208,7 +209,7 @@ if ($_POST) { write_config(); voucher_configure(); if (isset($config['voucher']['enable']) && !isset($config['captiveportal']['enable'])) { - $savemsg = "Don't forget to configure and enable Captive Portal."; + $savemsg = gettext("Don't forget to configure and enable Captive Portal."); } } } @@ -242,11 +243,11 @@ function enable_change(enable_change) {
@@ -258,18 +259,18 @@ function enable_change(enable_change) {| Roll# | -Minutes/Ticket | -# of Tickets | -Comment | +=gettext("Roll"); ?># | +=gettext("Minutes/Ticket"); ?> | +# =gettext("of Tickets"); ?> | +=gettext("Comment"); ?> |
- |
@@ -299,99 +300,99 @@ function enable_change(enable_change) {
| ";
}
?>
- Note:
- Changing any Voucher parameter (apart from managing the list of Rolls) on this page will render existing vouchers useless if they were generated with different settings.
+ =gettext("Note"); ?>:
+ =gettext("Changing any Voucher parameter (apart from managing the list of Rolls) on this page will render existing vouchers useless if they were generated with different settings"); ?>.