Implement gettext() calls on vpn_openvpn_csc.php

This commit is contained in:
Carlos Eduardo Ramos 2010-07-27 15:50:08 -03:00
parent 2fa7a4681f
commit deeda87428

View File

@ -37,7 +37,7 @@
require("guiconfig.inc");
require_once("openvpn.inc");
$pgtitle = array("OpenVPN", "Client Specific Override");
$pgtitle = array(gettext("OpenVPN"), gettext("Client Specific Override"));
$statusurl = "status_openvpn.php";
$logurl = "diag_logs_openvpn.php";
@ -128,36 +128,36 @@ if ($_POST) {
if ($pconfig['dns_server_enable']) {
if (!empty($pconfig['dns_server1']) && !is_ipaddr(trim($pconfig['dns_server1'])))
$input_errors[] = "The field 'DNS Server #1' must contain a valid IP address";
$input_errors[] = gettext("The field 'DNS Server #1' must contain a valid IP address");
if (!empty($pconfig['dns_server2']) && !is_ipaddr(trim($pconfig['dns_server2'])))
$input_errors[] = "The field 'DNS Server #2' must contain a valid IP address";
$input_errors[] = gettext("The field 'DNS Server #2' must contain a valid IP address");
if (!empty($pconfig['dns_server3']) && !is_ipaddr(trim($pconfig['dns_server3'])))
$input_errors[] = "The field 'DNS Server #3' must contain a valid IP address";
$input_errors[] = gettext("The field 'DNS Server #3' must contain a valid IP address");
if (!empty($pconfig['dns_server4']) && !is_ipaddr(trim($pconfig['dns_server4'])))
$input_errors[] = "The field 'DNS Server #4' must contain a valid IP address";
$input_errors[] = gettext("The field 'DNS Server #4' must contain a valid IP address");
}
if ($pconfig['ntp_server_enable']) {
if (!empty($pconfig['ntp_server1']) && !is_ipaddr(trim($pconfig['ntp_server1'])))
$input_errors[] = "The field 'NTP Server #1' must contain a valid IP address";
$input_errors[] = gettext("The field 'NTP Server #1' must contain a valid IP address");
if (!empty($pconfig['ntp_server2']) && !is_ipaddr(trim($pconfig['ntp_server2'])))
$input_errors[] = "The field 'NTP Server #2' must contain a valid IP address";
$input_errors[] = gettext("The field 'NTP Server #2' must contain a valid IP address");
if (!empty($pconfig['ntp_server3']) && !is_ipaddr(trim($pconfig['ntp_server3'])))
$input_errors[] = "The field 'NTP Server #3' must contain a valid IP address";
$input_errors[] = gettext("The field 'NTP Server #3' must contain a valid IP address");
if (!empty($pconfig['ntp_server4']) && !is_ipaddr(trim($pconfig['ntp_server4'])))
$input_errors[] = "The field 'NTP Server #4' must contain a valid IP address";
$input_errors[] = gettext("The field 'NTP Server #4' must contain a valid IP address");
}
if ($pconfig['netbios_enable']) {
if ($pconfig['wins_server_enable']) {
if (!empty($pconfig['wins_server1']) && !is_ipaddr(trim($pconfig['wins_server1'])))
$input_errors[] = "The field 'WINS Server #1' must contain a valid IP address";
$input_errors[] = gettext("The field 'WINS Server #1' must contain a valid IP address");
if (!empty($pconfig['wins_server2']) && !is_ipaddr(trim($pconfig['wins_server2'])))
$input_errors[] = "The field 'WINS Server #2' must contain a valid IP address";
$input_errors[] = gettext("The field 'WINS Server #2' must contain a valid IP address");
}
if ($pconfig['nbdd_server_enable'])
if (!empty($pconfig['nbdd_server1']) && !is_ipaddr(trim($pconfig['nbdd_server1'])))
$input_errors[] = "The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address";
$input_errors[] = gettext("The field 'NetBIOS Data Distribution Server #1' must contain a valid IP address");
}
$reqdfields[] = 'common_name';
@ -308,10 +308,10 @@ function netbios_change() {
<form action="vpn_openvpn_csc.php" method="post" name="iform" id="iform" onsubmit="presubmit()">
<table width="100%" border="0" cellpadding="6" cellspacing="0">
<tr>
<td colspan="2" valign="top" class="listtopic">General information</td>
<td colspan="2" valign="top" class="listtopic"><?=gettext("General information"); ?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Disabled</td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Disabled"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
@ -322,32 +322,32 @@ function netbios_change() {
<td>
&nbsp;
<span class="vexpl">
<strong>Disable this override</strong><br>
<strong><?=gettext("Disable this override"); ?></strong><br>
</span>
</td>
</tr>
</table>
Set this option to disable this client-specific override without removing it from the list.
<?=gettext("Set this option to disable this client-specific override without removing it from the list"); ?>.
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq">Common name</td>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Common name"); ?></td>
<td width="78%" class="vtable">
<input name="common_name" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['common_name']);?>">
<br>
Enter the client's X.509 common name here.
<?=gettext("Enter the client's X.509 common name here"); ?>.
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Description</td>
<td width="22%" valign="top" class="vncell"><?=gettext("Description"); ?></td>
<td width="78%" class="vtable">
<input name="description" type="text" class="formfld unknown" size="30" value="<?=htmlspecialchars($pconfig['description']);?>">
<br>
You may enter a description here for your reference (not parsed).
<?=gettext("You may enter a description here for your reference (not parsed)"); ?>.
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Connection blocking</td>
<td width="22%" valign="top" class="vncell"><?=gettext("Connection blocking"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -357,38 +357,38 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Block this client connection based on its common name.
<?=gettext("Block this client connection based on its common name"); ?>.
</span>
</td>
</tr>
</table>
Don't use this option to permanently disable a
client due to a compromised key or password.
Use a CRL (certificate revocation list) instead.
<?=gettext("Don't use this option to permanently disable a " .
"client due to a compromised key or password. " .
"Use a CRL (certificate revocation list) instead"); ?>.
</td>
</tr>
<tr>
<td colspan="2" class="list" height="12"></td>
</tr>
<tr>
<td colspan="2" valign="top" class="listtopic">Tunnel Settings</td>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Tunnel Settings"); ?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Tunnel Network</td>
<td width="22%" valign="top" class="vncell"><?=gettext("Tunnel Network"); ?></td>
<td width="78%" class="vtable">
<input name="tunnel_network" type="text" class="formfld unknown" size="20" value="<?=htmlspecialchars($pconfig['tunnel_network']);?>">
<br>
This is the virtual network used for private
communications between this client and the
server expressed using CIDR (eg. 10.0.8.0/24).
The first network address is assumed to be the
server address and the second network address
will be assigned to the client virtual
interface.
<?=gettext("This is the virtual network used for private " .
"communications between this client and the " .
"server expressed using CIDR (eg. 10.0.8.0/24). " .
"The first network address is assumed to be the " .
"server address and the second network address " .
"will be assigned to the client virtual " .
"interface"); ?>.
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Redirect Gateway</td>
<td width="22%" valign="top" class="vncell"><?=gettext("Redirect Gateway"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -398,7 +398,7 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Force all client generated traffic through the tunnel.
<?=gettext("Force all client generated traffic through the tunnel"); ?>.
</span>
</td>
</tr>
@ -409,10 +409,10 @@ function netbios_change() {
<td colspan="2" class="list" height="12"></td>
</tr>
<tr>
<td colspan="2" valign="top" class="listtopic">Client Settings</td>
<td colspan="2" valign="top" class="listtopic"><?=gettext("Client Settings"); ?></td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Server Definitions</td>
<td width="22%" valign="top" class="vncell"><?=gettext("Server Definitions"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -422,7 +422,7 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Prevent this client from receiving any server-defined client settings.
<?=gettext("Prevent this client from receiving any server-defined client settings"); ?>.
</span>
</td>
</tr>
@ -430,7 +430,7 @@ function netbios_change() {
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">DNS Default Domain</td>
<td width="22%" valign="top" class="vncell"><?=gettext("DNS Default Domain"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -440,7 +440,7 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Provide a default domain name to clients<br>
<?=gettext("Provide a default domain name to clients"); ?><br>
</span>
</td>
</tr>
@ -455,7 +455,7 @@ function netbios_change() {
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">DNS Servers</td>
<td width="22%" valign="top" class="vncell"><?=gettext("DNS Servers"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -465,7 +465,7 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Provide a DNS server list to clients<br>
<?=gettext("Provide a DNS server list to clients"); ?><br>
</span>
</td>
</tr>
@ -474,7 +474,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #1:&nbsp;
<?=gettext("Server"); ?> #1:&nbsp;
</span>
<input name="dns_server1" type="text" class="formfld unknown" id="dns_server1" size="20" value="<?=$pconfig['dns_server1'];?>">
</td>
@ -482,7 +482,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #2:&nbsp;
<?=gettext("Server"); ?> #2:&nbsp;
</span>
<input name="dns_server2" type="text" class="formfld unknown" id="dns_server2" size="20" value="<?=$pconfig['dns_server2'];?>">
</td>
@ -490,7 +490,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #3:&nbsp;
<?=gettext("Server"); ?> #3:&nbsp;
</span>
<input name="dns_server3" type="text" class="formfld unknown" id="dns_server3" size="20" value="<?=$pconfig['dns_server3'];?>">
</td>
@ -498,7 +498,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #4:&nbsp;
<?=gettext("Server"); ?> #4:&nbsp;
</span>
<input name="dns_server4" type="text" class="formfld unknown" id="dns_server4" size="20" value="<?=$pconfig['dns_server4'];?>">
</td>
@ -507,7 +507,7 @@ function netbios_change() {
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">NTP Servers</td>
<td width="22%" valign="top" class="vncell"><?=gettext("NTP Servers"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -517,7 +517,7 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Provide a NTP server list to clients<br>
<?=gettext("Provide a NTP server list to clients"); ?><br>
</span>
</td>
</tr>
@ -526,7 +526,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #1:&nbsp;
<?=gettext("Server"); ?> #1:&nbsp;
</span>
<input name="ntp_server1" type="text" class="formfld unknown" id="ntp_server1" size="20" value="<?=$pconfig['ntp_server1'];?>">
</td>
@ -534,7 +534,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #2:&nbsp;
<?=gettext("Server"); ?> #2:&nbsp;
</span>
<input name="ntp_server2" type="text" class="formfld unknown" id="ntp_server2" size="20" value="<?=$pconfig['ntp_server2'];?>">
</td>
@ -543,7 +543,7 @@ function netbios_change() {
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">NetBIOS Options</td>
<td width="22%" valign="top" class="vncell"><?=gettext("NetBIOS Options"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -553,19 +553,19 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Enable NetBIOS over TCP/IP<br>
<?=gettext("Enable NetBIOS over TCP/IP"); ?><br>
</span>
</td>
</tr>
</table>
If this option is not set, all NetBIOS-over-TCP/IP options (includeing WINS) will be disabled.
<?=gettext("If this option is not set, all NetBIOS-over-TCP/IP options (includeing WINS) will be disabled"); ?>.
<br/>
<table border="0" cellpadding="2" cellspacing="0" id="netbios_data">
<tr>
<td>
<br/>
<span class="vexpl">
Node Type:&nbsp;
<?=gettext("Node Type"); ?>:&nbsp;
</span>
<select name='netbios_ntype' class="formselect">
<?php
@ -578,10 +578,10 @@ function netbios_change() {
<?php endforeach; ?>
</select>
<br/>
Possible options: b-node (broadcasts), p-node
(point-to-point name queries to a WINS server),
m-node (broadcast then query name server), and
h-node (query name server, then broadcast).
<?=gettext("Possible options: b-node (broadcasts), p-node " .
"(point-to-point name queries to a WINS server), " .
"m-node (broadcast then query name server), and " .
"h-node (query name server, then broadcast)"); ?>.
</td>
</tr>
<tr>
@ -592,18 +592,18 @@ function netbios_change() {
</span>
<input name="netbios_scope" type="text" class="formfld unknown" id="netbios_scope" size="30" value="<?=htmlspecialchars($pconfig['netbios_scope']);?>">
<br/>
A NetBIOS Scope ID provides an extended naming
service for NetBIOS over TCP/IP. The NetBIOS
scope ID isolates NetBIOS traffic on a single
network to only those nodes with the same
NetBIOS scope ID.
<?=gettext("A NetBIOS Scope ID provides an extended naming " .
"service for NetBIOS over TCP/IP. The NetBIOS " .
"scope ID isolates NetBIOS traffic on a single " .
"network to only those nodes with the same " .
"NetBIOS scope ID"); ?>.
</td>
</tr>
</table>
</td>
</tr>
<tr id="wins_opts">
<td width="22%" valign="top" class="vncell">WINS Servers</td>
<td width="22%" valign="top" class="vncell"><?=gettext("WINS Servers"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
@ -613,7 +613,7 @@ function netbios_change() {
</td>
<td>
<span class="vexpl">
Provide a WINS server list to clients<br>
<?=gettext("Provide a WINS server list to clients"); ?><br>
</span>
</td>
</tr>
@ -622,7 +622,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #1:&nbsp;
<?=gettext("Server"); ?> #1:&nbsp;
</span>
<input name="wins_server1" type="text" class="formfld unknown" id="wins_server1" size="20" value="<?=$pconfig['wins_server1'];?>">
</td>
@ -630,7 +630,7 @@ function netbios_change() {
<tr>
<td>
<span class="vexpl">
Server #2:&nbsp;
<?=gettext("Server"); ?> #2:&nbsp;
</span>
<input name="wins_server2" type="text" class="formfld unknown" id="wins_server2" size="20" value="<?=$pconfig['wins_server2'];?>">
</td>
@ -639,14 +639,14 @@ function netbios_change() {
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncell">Advanced</td>
<td width="22%" valign="top" class="vncell"><?=gettext("Advanced"); ?></td>
<td width="78%" class="vtable">
<table border="0" cellpadding="2" cellspacing="0">
<tr>
<td>
<textarea rows="6" cols="78" name="custom_options" id="custom_options"><?=$pconfig['custom_options'];?></textarea><br/>
Enter any additional options you would like to add for this client specific override, separated by a semicolon<br/>
EXAMPLE: push "route 10.0.0.0 255.255.255.0";
<?=gettext("Enter any additional options you would like to add for this client specific override, separated by a semicolon"); ?><br/>
<?=gettext("EXAMPLE: push \"route 10.0.0.0 255.255.255.0\""); ?>;
</td>
</tr>
</table>
@ -655,7 +655,7 @@ function netbios_change() {
<tr>
<td width="22%" valign="top">&nbsp;</td>
<td width="78%">
<input name="save" type="submit" class="formbtn" value="Save">
<input name="save" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
<input name="act" type="hidden" value="<?=$act;?>">
<?php if (isset($id) && $a_csc[$id]): ?>
<input name="id" type="hidden" value="<?=$id;?>">
@ -669,9 +669,9 @@ function netbios_change() {
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="10%" class="listhdrr">Disabled</td>
<td width="40%" class="listhdrr">Common Name</td>
<td width="40%" class="listhdrr">Description</td>
<td width="10%" class="listhdrr"><?=gettext("Disabled"); ?></td>
<td width="40%" class="listhdrr"><?=gettext("Common Name"); ?></td>
<td width="40%" class="listhdrr"><?=gettext("Description"); ?></td>
<td width="10%" class="list"></td>
</tr>
<?php
@ -693,11 +693,11 @@ function netbios_change() {
</td>
<td valign="middle" nowrap class="list">
<a href="vpn_openvpn_csc.php?act=edit&id=<?=$i;?>">
<img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="edit csc" width="17" height="17" border="0">
<img src="./themes/<?=$g['theme'];?>/images/icons/icon_e.gif" title="<?=gettext("edit csc"); ?>" width="17" height="17" border="0">
</a>
&nbsp;
<a href="vpn_openvpn_csc.php?act=del&id=<?=$i;?>" onclick="return confirm('Do you really want to delete this csc?')">
<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="delete csc" width="17" height="17" border="0">
<a href="vpn_openvpn_csc.php?act=del&id=<?=$i;?>" onclick="return confirm('<?=gettext("Do you really want to delete this csc?"); ?>')">
<img src="/themes/<?=$g['theme'];?>/images/icons/icon_x.gif" title="<?=gettext("delete csc"); ?>" width="17" height="17" border="0">
</a>
</td>
</tr>
@ -708,7 +708,7 @@ function netbios_change() {
<tr>
<td class="list" colspan="3"></td>
<td class="list">
<a href="vpn_openvpn_csc.php?act=new"><img src="./themes/<?=$g['theme'];?>/images/icons/icon_plus.gif" title="add csc" width="17" height="17" border="0">
<a href="vpn_openvpn_csc.php?act=new"><img src="./themes/<?=$g['theme'];?>/images/icons/icon_plus.gif" title="<?=gettext("add csc"); ?>" width="17" height="17" border="0">
</a>
</td>
</tr>