mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-16 01:24:38 +00:00
openvpn: translate validated field names while at it #2536
This commit is contained in:
parent
399d719ede
commit
69fef9cb9e
@ -409,31 +409,31 @@ function step10_submitphpaction()
|
||||
$config['wizardtemp']['step10']['localport'] = $_POST['localport'] = openvpn_port_next($_POST['protocol']);
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_port($_POST['localport'], 'Local port')) {
|
||||
if ($result = openvpn_validate_port($_POST['localport'], gettext('Local port'))) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($_POST['tunnelnet'], 'IPv4 Tunnel Network', false, 'ipv4')) {
|
||||
if ($result = openvpn_validate_cidr($_POST['tunnelnet'], gettext('IPv4 Tunnel Network'), false, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($_POST['tunnelnetv6'], 'IPv6 Tunnel Network', false, 'ipv6')) {
|
||||
if ($result = openvpn_validate_cidr($_POST['tunnelnetv6'], gettext('IPv6 Tunnel Network'), false, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($_POST['localnet'], 'IPv4 Local Network', true, 'ipv4')) {
|
||||
if ($result = openvpn_validate_cidr($_POST['localnet'], gettext('IPv4 Local Network'), true, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($_POST['localnetv6'], 'IPv6 Local Network', true, 'ipv6')) {
|
||||
if ($result = openvpn_validate_cidr($_POST['localnetv6'], gettext('IPv6 Local Network'), true, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($_POST['remotenet'], 'IPv4 Remote Network', true, 'ipv4')) {
|
||||
if ($result = openvpn_validate_cidr($_POST['remotenet'], gettext('IPv4 Remote Network'), true, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($_POST['remotenetv6'], 'IPv6 Remote Network', true, 'ipv6')) {
|
||||
if ($result = openvpn_validate_cidr($_POST['remotenetv6'], gettext('IPv6 Remote Network'), true, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
|
||||
@ -251,16 +251,16 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network', false, "ipv4")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], gettext('IPv4 Tunnel Network'), false, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], 'IPv6 Tunnel Network', false, "ipv6")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], gettext('IPv6 Tunnel Network'), false, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'IPv4 Remote Network', true, "ipv4")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_network'], gettext('IPv4 Remote Network'), true, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], 'IPv6 Remote Network', true, "ipv6")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], gettext('IPv6 Remote Network'), true, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if (!empty($pconfig['use_shaper']) && (!is_numeric($pconfig['use_shaper']) || ($pconfig['use_shaper'] <= 0))) {
|
||||
|
||||
@ -118,23 +118,22 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
header(url_safe('Location: /vpn_openvpn_csc.php'));
|
||||
exit;
|
||||
} else {
|
||||
/* perform validations */
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network', false, 'ipv4', true)) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], gettext('IPv4 Tunnel Network'), false, 'ipv4', true)) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], 'IPv6 Tunnel Network', false, 'ipv6', true)) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], gettext('IPv6 Tunnel Network'), false, 'ipv6', true)) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_network'], 'IPv4 Local Network', true, "ipv4")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_network'], gettext('IPv4 Local Network'), true, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_networkv6'], 'IPv6 Local Network', true, "ipv6")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_networkv6'], gettext('IPv6 Local Network'), true, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'IPv4 Remote Network', true, "ipv4")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_network'], gettext('IPv4 Remote Network'), true, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], 'IPv6 Remote Network', true, "ipv6")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], gettext('IPv6 Remote Network'), true, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
|
||||
@ -196,31 +196,31 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
$input_errors[] = gettext("You must select a Backend for Authentication if the server mode requires User Auth.");
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_port($pconfig['local_port'], 'Local port')) {
|
||||
if ($result = openvpn_validate_port($pconfig['local_port'], gettext('Local port'))) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], 'IPv4 Tunnel Network', false, "ipv4")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_network'], gettext('IPv4 Tunnel Network'), false, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], 'IPv6 Tunnel Network', false, "ipv6")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['tunnel_networkv6'], gettext('IPv6 Tunnel Network'), false, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_network'], 'IPv4 Remote Network', true, "ipv4")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_network'], gettext('IPv4 Remote Network'), true, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], 'IPv6 Remote Network', true, "ipv6")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['remote_networkv6'], gettext('IPv6 Remote Network'), true, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_network'], 'IPv4 Local Network', true, "ipv4")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_network'], gettext('IPv4 Local Network'), true, 'ipv4')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_networkv6'], 'IPv6 Local Network', true, "ipv6")) {
|
||||
if ($result = openvpn_validate_cidr($pconfig['local_networkv6'], gettext('IPv6 Local Network'), true, 'ipv6')) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
|
||||
@ -281,7 +281,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') {
|
||||
}
|
||||
|
||||
if (!empty($pconfig['client_mgmt_port_enable'])) {
|
||||
if ($result = openvpn_validate_port($pconfig['client_mgmt_port'], 'Client management port')) {
|
||||
if ($result = openvpn_validate_port($pconfig['client_mgmt_port'], gettext('Client management port'))) {
|
||||
$input_errors[] = $result;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user