summaryrefslogtreecommitdiffstats
path: root/src/usr/local/www/vpn_ipsec_keys_edit.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr/local/www/vpn_ipsec_keys_edit.php')
-rw-r--r--src/usr/local/www/vpn_ipsec_keys_edit.php114
1 files changed, 51 insertions, 63 deletions
diff --git a/src/usr/local/www/vpn_ipsec_keys_edit.php b/src/usr/local/www/vpn_ipsec_keys_edit.php
index 6419a6b..d4037c4 100644
--- a/src/usr/local/www/vpn_ipsec_keys_edit.php
+++ b/src/usr/local/www/vpn_ipsec_keys_edit.php
@@ -133,67 +133,55 @@ include("head.inc");
?>
-<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
-<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
-<form action="vpn_ipsec_keys_edit.php" method="post" name="iform" id="iform">
- <table width="100%" border="0" cellpadding="6" cellspacing="0" summary="vpn ipsec keys edit">
- <tr>
- <td colspan="2" valign="top" class="listtopic">Edit pre-shared secret</td>
- </tr>
- <tr>
- <td valign="top" class="vncellreq"><?=gettext("Identifier"); ?></td>
- <td class="vtable">
- <?=$mandfldhtml;?><input name="ident" type="text" class="formfld unknown" id="ident" size="30" value="<?=htmlspecialchars($pconfig['ident']);?>" />
- <br />
- <?=gettext("This can be either an IP address, fully qualified domain name or an e-mail address"); ?>.
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Secret type"); ?></td>
- <td width="78%" class="vtable">
- <select name="type" class="formselect">
- <?php
- foreach ($ipsec_preshared_key_type as $value => $descr) {
- echo "<option value='{$value}' ";
- if ($pconfig['type'] == $value) {
- echo "selected=\"selected\"";
- }
- echo ">{$descr}</option>";
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top" class="vncellreq"><?=gettext("Pre-Shared Key"); ?></td>
- <td width="78%" class="vtable">
- <?=$mandfldhtml;?><input name="psk" type="text" class="formfld unknown" id="psk" size="40" value="<?=htmlspecialchars($pconfig['psk']);?>" />
- </td>
- </tr>
- <tr>
- <td width="22%" valign="top">&nbsp;</td>
- <td width="78%">
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" />
- <?php if (isset($id) && $a_secret[$id]): ?>
- <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" />
- <?php endif; ?>
- </td>
- </tr>
- <tr>
- <td colspan="4">
- <p>
- <span class="vexpl">
- <span class="red">
- <strong><?=gettext("Note"); ?>:<br /></strong>
- </span>
- <?=gettext("PSK for any user can be set by using an identifier of any/ANY");?>
- </span>
- </p>
- </td>
- </tr>
- </table>
-</form>
-<?php include("fend.inc"); ?>
-</body>
-</html>
+
+<?php
+
+require('classes/Form.class.php');
+$form = new Form;
+
+$section = new Form_Section('Edit pre-shared-secret');
+
+$section->addInput(new Form_Input(
+ 'ident',
+ 'Identifier',
+ 'text',
+ $pconfig['ident']
+))->setHelp('This can be either an IP address, fully qualified domain name or an e-mail address');
+
+$section->addInput(new Form_Select(
+ 'type',
+ 'Secret type',
+ $pconfig['type'],
+ $ipsec_preshared_key_type
+))->setWidth(2);
+
+$section->addInput(new Form_Input(
+ 'psk',
+ 'Pre-Shared Key',
+ 'text',
+ $pconfig['psk']
+));
+
+if (isset($id) && $a_secret[$id])
+{
+ $form->addGlobal(new Form_Input(
+ 'id',
+ false,
+ 'hidden',
+ $id
+ ));
+}
+
+$form->add($section);
+
+print $form;
+
+?>
+
+<div class="alert alert-info">
+ <strong><?=gettext("Note"); ?>:</strong><br />
+ <?=gettext("PSK for any user can be set by using an identifier of any/ANY")?>
+</div>
+
+<?php include("foot.inc"); ?> \ No newline at end of file
OpenPOWER on IntegriCloud