Revision 4b1f6c12
Added by Carlos Eduardo Ramos about 15 years ago
usr/local/www/vpn_ipsec_keys_edit.php | ||
---|---|---|
66 | 66 |
|
67 | 67 |
/* input validation */ |
68 | 68 |
$reqdfields = explode(" ", "ident psk"); |
69 |
$reqdfieldsn = explode(",", "Identifier,Pre-shared key");
|
|
69 |
$reqdfieldsn = array(gettext("Identifier,Pre-shared key"));
|
|
70 | 70 |
|
71 | 71 |
do_input_validation($_POST, $reqdfields, $reqdfieldsn, &$input_errors); |
72 | 72 |
|
73 | 73 |
if (preg_match("/[^a-zA-Z0-9@\.\-]/", $_POST['ident'])) |
74 |
$input_errors[] = "The identifier contains invalid characters.";
|
|
74 |
$input_errors[] = gettext("The identifier contains invalid characters.");
|
|
75 | 75 |
|
76 | 76 |
if (array_key_exists($_POST['ident'], $userids)) |
77 |
$input_errors[] = "A user with this name already exists. Add the key to the user instead.";
|
|
77 |
$input_errors[] = gettext("A user with this name already exists. Add the key to the user instead.");
|
|
78 | 78 |
|
79 | 79 |
if (!$input_errors && !(isset($id) && $a_secret[$id])) { |
80 | 80 |
/* make sure there are no dupes */ |
81 | 81 |
foreach ($a_secret as $secretent) { |
82 | 82 |
if ($secretent['ident'] == $_POST['ident']) { |
83 |
$input_errors[] = "Another entry with the same identifier already exists.";
|
|
83 |
$input_errors[] = gettext("Another entry with the same identifier already exists.");
|
|
84 | 84 |
break; |
85 | 85 |
} |
86 | 86 |
} |
... | ... | |
97 | 97 |
|
98 | 98 |
if (isset($id) && $a_secret[$id]) { |
99 | 99 |
$a_secret[$id] = $secretent; |
100 |
$text = "Edited";
|
|
100 |
$text = gettext("Edited");
|
|
101 | 101 |
} else { |
102 | 102 |
$a_secret[] = $secretent; |
103 |
$text = "Added";
|
|
103 |
$text = gettext("Added");
|
|
104 | 104 |
} |
105 | 105 |
|
106 | 106 |
write_config("{$text} IPsec Pre-Shared Keys"); |
... | ... | |
111 | 111 |
} |
112 | 112 |
} |
113 | 113 |
|
114 |
$pgtitle = "VPN: IPsec: Edit pre-shared key";
|
|
114 |
$pgtitle = gettext("VPN: IPsec: Edit pre-shared key");
|
|
115 | 115 |
$statusurl = "diag_ipsec.php"; |
116 | 116 |
$logurl = "diag_logs_ipsec.php"; |
117 | 117 |
|
... | ... | |
125 | 125 |
<form action="vpn_ipsec_keys_edit.php" method="post" name="iform" id="iform"> |
126 | 126 |
<table width="100%" border="0" cellpadding="6" cellspacing="0"> |
127 | 127 |
<tr> |
128 |
<td valign="top" class="vncellreq">Identifier</td>
|
|
128 |
<td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td>
|
|
129 | 129 |
<td class="vtable"> |
130 | 130 |
<?=$mandfldhtml;?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=$pconfig['ident'];?>"> |
131 | 131 |
<br> |
132 |
This can be either an IP address, fully qualified domain name or an e-mail address.
|
|
132 |
<?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>.
|
|
133 | 133 |
</td> |
134 | 134 |
</tr> |
135 | 135 |
<tr> |
136 |
<td width="22%" valign="top" class="vncellreq">Pre-shared key</td>
|
|
136 |
<td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-shared key"); ?></td>
|
|
137 | 137 |
<td width="78%" class="vtable"> |
138 | 138 |
<?=$mandfldhtml;?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>"> |
139 | 139 |
</td> |
... | ... | |
141 | 141 |
<tr> |
142 | 142 |
<td width="22%" valign="top"> </td> |
143 | 143 |
<td width="78%"> |
144 |
<input name="Submit" type="submit" class="formbtn" value="Save">
|
|
144 |
<input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>">
|
|
145 | 145 |
<?php if (isset($id) && $a_secret[$id]): ?> |
146 | 146 |
<input name="id" type="hidden" value="<?=$id;?>"> |
147 | 147 |
<?php endif; ?> |
Also available in: Unified diff
Implement gettext() calls on vpn_ipsec_keys_edit.php