Revision 4aa02281
Added by Carlos Eduardo Ramos almost 15 years ago
etc/inc/openvpn.inc | ||
---|---|---|
72 | 72 |
1024, 2048, 4096 ); |
73 | 73 |
|
74 | 74 |
$openvpn_server_modes = array( |
75 |
'p2p_tls' => "Peer to Peer ( SSL/TLS )",
|
|
76 |
'p2p_shared_key' => "Peer to Peer ( Shared Key )",
|
|
77 |
'server_tls' => "Remote Access ( SSL/TLS )",
|
|
78 |
'server_user' => "Remote Access ( User Auth )",
|
|
79 |
'server_tls_user' => "Remote Access ( SSL/TLS + User Auth )");
|
|
75 |
'p2p_tls' => gettext("Peer to Peer ( SSL/TLS )"),
|
|
76 |
'p2p_shared_key' => gettext("Peer to Peer ( Shared Key )"),
|
|
77 |
'server_tls' => gettext("Remote Access ( SSL/TLS )"),
|
|
78 |
'server_user' => gettext("Remote Access ( User Auth )"),
|
|
79 |
'server_tls_user' => gettext("Remote Access ( SSL/TLS + User Auth )"));
|
|
80 | 80 |
|
81 | 81 |
$openvpn_client_modes = array( |
82 |
'p2p_tls' => "Peer to Peer ( SSL/TLS )",
|
|
83 |
'p2p_shared_key' => "Peer to Peer ( Shared Key )" );
|
|
82 |
'p2p_tls' => gettext("Peer to Peer ( SSL/TLS )"),
|
|
83 |
'p2p_shared_key' => gettext("Peer to Peer ( Shared Key )") );
|
|
84 | 84 |
|
85 | 85 |
function openvpn_create_key() { |
86 | 86 |
|
... | ... | |
168 | 168 |
$words = explode(' ', $line); |
169 | 169 |
$ciphers[$words[0]] = "{$words[0]} {$words[1]}"; |
170 | 170 |
} |
171 |
$ciphers["none"] = "None (No Encryption)";
|
|
171 |
$ciphers["none"] = gettext("None (No Encryption)");
|
|
172 | 172 |
return $ciphers; |
173 | 173 |
} |
174 | 174 |
|
175 | 175 |
function openvpn_validate_host($value, $name) { |
176 | 176 |
$value = trim($value); |
177 | 177 |
if (empty($value) || (!is_domain($value) && !is_ipaddr($value))) |
178 |
return "The field '$name' must contain a valid IP address or domain name.";
|
|
178 |
return sprintf(gettext("The field '%s' must contain a valid IP address or domain name."), $name);
|
|
179 | 179 |
return false; |
180 | 180 |
} |
181 | 181 |
|
182 | 182 |
function openvpn_validate_port($value, $name) { |
183 | 183 |
$value = trim($value); |
184 | 184 |
if (empty($value) || !is_numeric($value) || $value < 0 || ($value > 65535)) |
185 |
return "The field '$name' must contain a valid port, ranging from 0 to 65535.";
|
|
185 |
return sprintf(gettext("The field '%s' must contain a valid port, ranging from 0 to 65535."), $name);
|
|
186 | 186 |
return false; |
187 | 187 |
} |
188 | 188 |
|
... | ... | |
191 | 191 |
if (!empty($value)) { |
192 | 192 |
list($ip, $mask) = explode('/', $value); |
193 | 193 |
if (!is_ipaddr($ip) or !is_numeric($mask) or ($mask > 32) or ($mask < 0)) |
194 |
return "The field '$name' must contain a valid CIDR range.";
|
|
194 |
return sprintf(gettext("The field '%s' must contain a valid CIDR range."), $name);
|
|
195 | 195 |
} |
196 | 196 |
return false; |
197 | 197 |
} |
Also available in: Unified diff
Implement gettext() calls on openvpn.inc