summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_captiveportal_vouchers.php
diff options
context:
space:
mode:
authorColin Fleming <cj_fleming@sky.com>2014-04-03 16:01:17 +0100
committerColin Fleming <cj_fleming@sky.com>2014-04-03 16:01:17 +0100
commite25742f0d0857ef997f98b7c6b7ae7b020a1b80a (patch)
treec1fce7af02ddf8438229f1b3a93486b77fffd951 /usr/local/www/services_captiveportal_vouchers.php
parenta4b1bf88bbdc0b05f39c5dcca245ccf3f0563f7d (diff)
downloadpfsense-e25742f0d0857ef997f98b7c6b7ae7b020a1b80a.zip
pfsense-e25742f0d0857ef997f98b7c6b7ae7b020a1b80a.tar.gz
Tidy up "services_captiveportal_vouchers" XHTML
Add closehead varaiable, move script into HEAD and close HEAD manually Add BODY Remove unordered list tag Update HTML Boolean Operators Close INPUT Deprecate ampersand Close IMG and add ALT Add CDATA sections to script
Diffstat (limited to 'usr/local/www/services_captiveportal_vouchers.php')
-rw-r--r--usr/local/www/services_captiveportal_vouchers.php58
1 files changed, 30 insertions, 28 deletions
diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php
index 4d88804..b25b784 100644
--- a/usr/local/www/services_captiveportal_vouchers.php
+++ b/usr/local/www/services_captiveportal_vouchers.php
@@ -359,11 +359,11 @@ EOF;
}
}
}
+$closehead = false;
include("head.inc");
?>
-<?php include("fbegin.inc"); ?>
<script type="text/javascript">
-<!--
+//<![CDATA[
function generatenewkey() {
jQuery('#publickey').val('One moment please...');
jQuery('#privatekey').val('One moment please...');
@@ -423,15 +423,17 @@ function enable_change(enable_change) {
jQuery('#addnewroll').show();
}
}
-//-->
+//]]>
</script>
+</head>
+<body link="#0000CC" vlink="#0000CC" alink="#0000CC">
+<?php include("fbegin.inc"); ?>
<?php if ($input_errors) print_input_errors($input_errors); ?>
<?php if ($savemsg) print_info_box($savemsg); ?>
<form action="services_captiveportal_vouchers.php" method="post" enctype="multipart/form-data" name="iform" id="iform">
<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="tab pane">
<tr>
<td class="tabnavtbl">
- <ul id="tabnav">
<?php
$tab_array = array();
$tab_array[] = array(gettext("Captive portal(s)"), false, "services_captiveportal.php?zone={$cpzone}");
@@ -442,7 +444,6 @@ function enable_change(enable_change) {
$tab_array[] = array(gettext("File Manager"), false, "services_captiveportal_filemanager.php?zone={$cpzone}");
display_top_tabs($tab_array, true);
?>
- </ul>
</td>
</tr>
<tr>
@@ -451,7 +452,7 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vtable">&nbsp;</td>
<td width="78%" class="vtable">
- <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked"; ?> onClick="enable_change(false)">
+ <input name="enable" type="checkbox" value="yes" <?php if ($pconfig['enable']) echo "checked=\"checked\""; ?> onclick="enable_change(false)" />
<strong><?=gettext("Enable Vouchers"); ?></strong>
</td>
</tr>
@@ -489,9 +490,9 @@ function enable_change(enable_change) {
<td valign="middle" nowrap class="list">
<div id='addeditdelete<?=$i?>'>
<?php if ($pconfig['enable']): ?>
- <a href="services_captiveportal_vouchers_edit.php?zone=<?=$cpzone;?>&id=<?=$i; ?>"><img src="/themes/<?=$g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit voucher"); ?>" width="17" height="17" border="0" alt="<?=gettext("edit voucher"); ?>"></a>
- <a href="services_captiveportal_vouchers.php?zone=<?=$cpzone;?>&act=del&amp;id=<?=$i; ?>" onclick="return confirm('<?=gettext("Do you really want to delete this voucher? This makes all vouchers from this roll invalid"); ?>')"><img src="/themes/<?=$g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete vouchers"); ?>" width="17" height="17" border="0" alt="<?=gettext("delete vouchers"); ?>"></a>
- <a href="services_captiveportal_vouchers.php?zone=<?=$cpzone;?>&act=csv&amp;id=<?=$i; ?>"><img src="/themes/<?=$g['theme']; ?>/images/icons/icon_log_s.gif" title="<?=gettext("generate vouchers for this roll to CSV file"); ?>" width="11" height="15" border="0" alt="<?=gettext("generate vouchers for this roll to CSV file"); ?>"></a>
+ <a href="services_captiveportal_vouchers_edit.php?zone=<?=$cpzone;?>&amp;id=<?=$i; ?>"><img src="/themes/<?=$g['theme']; ?>/images/icons/icon_e.gif" title="<?=gettext("edit voucher"); ?>" width="17" height="17" border="0" alt="<?=gettext("edit voucher"); ?>" /></a>
+ <a href="services_captiveportal_vouchers.php?zone=<?=$cpzone;?>&amp;act=del&amp;id=<?=$i; ?>" onclick="return confirm('<?=gettext("Do you really want to delete this voucher? This makes all vouchers from this roll invalid"); ?>')"><img src="/themes/<?=$g['theme']; ?>/images/icons/icon_x.gif" title="<?=gettext("delete vouchers"); ?>" width="17" height="17" border="0" alt="<?=gettext("delete vouchers"); ?>" /></a>
+ <a href="services_captiveportal_vouchers.php?zone=<?=$cpzone;?>&amp;act=csv&amp;id=<?=$i; ?>"><img src="/themes/<?=$g['theme']; ?>/images/icons/icon_log_s.gif" title="<?=gettext("generate vouchers for this roll to CSV file"); ?>" width="11" height="15" border="0" alt="<?=gettext("generate vouchers for this roll to CSV file"); ?>" /></a>
<?php endif;?>
</div>
</td>
@@ -501,7 +502,7 @@ function enable_change(enable_change) {
<td class="list" colspan="4"></td>
<?php
if ($pconfig['enable'])
- echo "<td class=\"list\"><div id='addnewroll'> <a href=\"services_captiveportal_vouchers_edit.php?zone={$cpzone}\"><img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" title=\"" . gettext("add voucher") . "\" width=\"17\" height=\"17\" border=\"0\" alt=\"" . gettext("add voucher") . "\"></a></div></td>";
+ echo "<td class=\"list\"><div id='addnewroll'> <a href=\"services_captiveportal_vouchers_edit.php?zone={$cpzone}\"><img src=\"/themes/{$g['theme']}/images/icons/icon_plus.gif\" title=\"" . gettext("add voucher") . "\" width=\"17\" height=\"17\" border=\"0\" alt=\"" . gettext("add voucher") . "\" /></a></div></td>";
?>
</tr>
</table>
@@ -522,20 +523,19 @@ function enable_change(enable_change) {
<td class="vtable">
<textarea name="publickey" cols="65" rows="4" id="publickey" class="formpre"><?=htmlspecialchars($pconfig['publickey']);?></textarea>
<br />
- <?=gettext("Paste an RSA public key (64 Bit or smaller) in PEM format here. This key is used to decrypt vouchers."); ?> <a href='#' onClick='generatenewkey();'><?=gettext('Generate');?></a> <?=gettext('new key');?>.</td>
+ <?=gettext("Paste an RSA public key (64 Bit or smaller) in PEM format here. This key is used to decrypt vouchers."); ?> <a href='#' onclick='generatenewkey();'><?=gettext('Generate');?></a> <?=gettext('new key');?>.</td>
</tr>
<tr>
<td valign="top" class="vncell"><?=gettext("Voucher private key"); ?></td>
<td class="vtable">
<textarea name="privatekey" cols="65" rows="5" id="privatekey" class="formpre"><?=htmlspecialchars($pconfig['privatekey']);?></textarea>
<br />
- <?=gettext("Paste an RSA private key (64 Bit or smaller) in PEM format here. This key is only used to generate encrypted vouchers and doesn't need to be available if the vouchers have been generated offline."); ?> <a href='#' onClick='generatenewkey();'> <?=gettext('Generate');?></a> <?=gettext('new key');?>.</td>
- </td>
+ <?=gettext("Paste an RSA private key (64 Bit or smaller) in PEM format here. This key is only used to generate encrypted vouchers and doesn't need to be available if the vouchers have been generated offline."); ?> <a href='#' onclick='generatenewkey();'> <?=gettext('Generate');?></a> <?=gettext('new key');?>.</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Character set"); ?></td>
<td width="78%" class="vtable">
- <input name="charset" type="text" class="formfld" id="charset" size="80" value="<?=htmlspecialchars($pconfig['charset']);?>">
+ <input name="charset" type="text" class="formfld" id="charset" size="80" value="<?=htmlspecialchars($pconfig['charset']);?>" />
<br />
<?=gettext("Tickets are generated with the specified character set. It should contain printable characters (numbers, lower case and upper case letters) that are hard to confuse with others. Avoid e.g. 0/O and l/1."); ?>
</td>
@@ -543,7 +543,7 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncellreq"># <?=gettext("of Roll Bits"); ?></td>
<td width="78%" class="vtable">
- <input name="rollbits" type="text" class="formfld" id="rollbits" size="2" value="<?=htmlspecialchars($pconfig['rollbits']);?>">
+ <input name="rollbits" type="text" class="formfld" id="rollbits" size="2" value="<?=htmlspecialchars($pconfig['rollbits']);?>" />
<br />
<?=gettext("Reserves a range in each voucher to store the Roll # it belongs to. Allowed range: 1..31. Sum of Roll+Ticket+Checksum bits must be one Bit less than the RSA key size."); ?>
</td>
@@ -551,7 +551,7 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncellreq"># <?=gettext("of Ticket Bits"); ?></td>
<td width="78%" class="vtable">
- <input name="ticketbits" type="text" class="formfld" id="ticketbits" size="2" value="<?=htmlspecialchars($pconfig['ticketbits']);?>">
+ <input name="ticketbits" type="text" class="formfld" id="ticketbits" size="2" value="<?=htmlspecialchars($pconfig['ticketbits']);?>" />
<br />
<?=gettext("Reserves a range in each voucher to store the Ticket# it belongs to. Allowed range: 1..16. Using 16 bits allows a roll to have up to 65535 vouchers. A bit array, stored in RAM and in the config, is used to mark if a voucher has been used. A bit array for 65535 vouchers requires 8 KB of storage."); ?>
</td>
@@ -559,7 +559,7 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncellreq"># <?=gettext("of Checksum Bits"); ?></td>
<td width="78%" class="vtable">
- <input name="checksumbits" type="text" class="formfld" id="checksumbits" size="2" value="<?=htmlspecialchars($pconfig['checksumbits']);?>">
+ <input name="checksumbits" type="text" class="formfld" id="checksumbits" size="2" value="<?=htmlspecialchars($pconfig['checksumbits']);?>" />
<br />
<?=gettext("Reserves a range in each voucher to store a simple checksum over Roll # and Ticket#. Allowed range is 0..31."); ?>
</td>
@@ -567,7 +567,7 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Magic Number"); ?></td>
<td width="78%" class="vtable">
- <input name="magic" type="text" class="formfld" id="magic" size="20" value="<?=htmlspecialchars($pconfig['magic']);?>">
+ <input name="magic" type="text" class="formfld" id="magic" size="20" value="<?=htmlspecialchars($pconfig['magic']);?>" />
<br />
<?=gettext("Magic number stored in every voucher. Verified during voucher check. Size depends on how many bits are left by Roll+Ticket+Checksum bits. If all bits are used, no magic number will be used and checked."); ?>
</td>
@@ -575,14 +575,14 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Invalid Voucher Message"); ?></td>
<td width="78%" class="vtable">
- <input name="msgnoaccess" type="text" class="formfld" id="msgnoaccess" size="80" value="<?=htmlspecialchars($pconfig['msgnoaccess']);?>">
+ <input name="msgnoaccess" type="text" class="formfld" id="msgnoaccess" size="80" value="<?=htmlspecialchars($pconfig['msgnoaccess']);?>" />
<br /><?=gettext("Error message displayed for invalid vouchers on captive portal error page"); ?> ($PORTAL_MESSAGE$).
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Expired Voucher Message"); ?></td>
<td width="78%" class="vtable">
- <input name="msgexpired" type="text" class="formfld" id="msgexpired" size="80" value="<?=htmlspecialchars($pconfig['msgexpired']);?>">
+ <input name="msgexpired" type="text" class="formfld" id="msgexpired" size="80" value="<?=htmlspecialchars($pconfig['msgexpired']);?>" />
<br /><?=gettext("Error message displayed for expired vouchers on captive portal error page"); ?> ($PORTAL_MESSAGE$).
</td>
</tr>
@@ -598,7 +598,7 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Synchronize Voucher Database IP"); ?></td>
<td width="78%" class="vtable">
- <input name="vouchersyncdbip" type="text" class="formfld" id="vouchersyncdbip" size="17" value="<?=htmlspecialchars($pconfig['vouchersyncdbip']);?>">
+ <input name="vouchersyncdbip" type="text" class="formfld" id="vouchersyncdbip" size="17" value="<?=htmlspecialchars($pconfig['vouchersyncdbip']);?>" />
<br /><?=gettext("IP address of master nodes webConfigurator to synchronize voucher database and used vouchers from."); ?>
<br /><?=gettext("NOTE: this should be setup on the slave nodes and not the primary node!"); ?>
</td>
@@ -606,21 +606,21 @@ function enable_change(enable_change) {
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Voucher sync port"); ?></td>
<td width="78%" class="vtable">
- <input name="vouchersyncport" type="text" class="formfld" id="vouchersyncport" size="7" value="<?=htmlspecialchars($pconfig['vouchersyncport']);?>">
+ <input name="vouchersyncport" type="text" class="formfld" id="vouchersyncport" size="7" value="<?=htmlspecialchars($pconfig['vouchersyncport']);?>" />
<br /><?=gettext("This is the port of the master voucher nodes webConfigurator. Example: 443"); ?>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Voucher sync username"); ?></td>
<td width="78%" class="vtable">
- <input name="vouchersyncusername" type="text" class="formfld" id="vouchersyncusername" size="25" value="<?=htmlspecialchars($pconfig['vouchersyncusername']);?>" autocomplete="off">
+ <input name="vouchersyncusername" type="text" class="formfld" id="vouchersyncusername" size="25" value="<?=htmlspecialchars($pconfig['vouchersyncusername']);?>" autocomplete="off" />
<br /><?=gettext("This is the username of the master voucher nodes webConfigurator."); ?>
</td>
</tr>
<tr>
<td width="22%" valign="top" class="vncellreq"><?=gettext("Voucher sync password"); ?></td>
<td width="78%" class="vtable">
- <input name="vouchersyncpass" type="password" class="formfld" id="vouchersyncpass" size="25" value="<?=htmlspecialchars($pconfig['vouchersyncpass']);?>" autocomplete="off">
+ <input name="vouchersyncpass" type="password" class="formfld" id="vouchersyncpass" size="25" value="<?=htmlspecialchars($pconfig['vouchersyncpass']);?>" autocomplete="off" />
<br /><?=gettext("This is the password of the master voucher nodes webConfigurator."); ?>
</td>
</tr>
@@ -629,8 +629,8 @@ function enable_change(enable_change) {
<td width="78%">
<input type="hidden" name="zone" id="zone" value="<?=htmlspecialchars($cpzone);?>" />
<input type="hidden" name="exponent" id="exponent" value="<?=$pconfig['exponent'];?>" />
- <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onClick="enable_change(true); before_save();">
- <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()">
+ <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" onclick="enable_change(true); before_save();" />
+ <input type="button" class="formbtn" value="<?=gettext("Cancel"); ?>" onclick="history.back()" />
</td>
</tr>
<tr>
@@ -648,8 +648,10 @@ function enable_change(enable_change) {
</table>
</form>
<script type="text/javascript">
-<!--
+//<![CDATA[
enable_change(false);
-//-->
+//]]>
</script>
<?php include("fend.inc"); ?>
+</body>
+</html>
OpenPOWER on IntegriCloud