diff options
Diffstat (limited to 'usr')
-rw-r--r-- | usr/local/www/services_captiveportal_vouchers.php | 58 | ||||
-rw-r--r-- | usr/local/www/services_captiveportal_vouchers_edit.php | 17 |
2 files changed, 40 insertions, 35 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"> </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&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&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;?>&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&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&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> diff --git a/usr/local/www/services_captiveportal_vouchers_edit.php b/usr/local/www/services_captiveportal_vouchers_edit.php index ca1095b..7d449d0 100644 --- a/usr/local/www/services_captiveportal_vouchers_edit.php +++ b/usr/local/www/services_captiveportal_vouchers_edit.php @@ -163,6 +163,7 @@ if ($_POST) { include("head.inc"); ?> +<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); ?> @@ -171,7 +172,7 @@ include("head.inc"); <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Roll"); ?>#</td> <td width="78%" class="vtable"> - <?=$mandfldhtml;?><input name="number" type="text" class="formfld" id="number" size="10" value="<?=htmlspecialchars($pconfig['number']);?>"> + <?=$mandfldhtml;?><input name="number" type="text" class="formfld" id="number" size="10" value="<?=htmlspecialchars($pconfig['number']);?>" /> <br /> <span class="vexpl"><?=gettext("Enter the Roll"); ?># (0..<?=htmlspecialchars($maxnumber);?>) <?=gettext("found on top of the generated/printed vouchers"); ?>.</span> </td> @@ -179,7 +180,7 @@ include("head.inc"); <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Minutes per Ticket"); ?></td> <td width="78%" class="vtable"> - <?=$mandfldhtml;?><input name="minutes" type="text" class="formfld" id="minutes" size="10" value="<?=htmlspecialchars($pconfig['minutes']);?>"> + <?=$mandfldhtml;?><input name="minutes" type="text" class="formfld" id="minutes" size="10" value="<?=htmlspecialchars($pconfig['minutes']);?>" /> <br /> <span class="vexpl"><?=gettext("Defines the time in minutes that a user is allowed access. The clock starts ticking the first time a voucher is used for authentication"); ?>.</span> </td> @@ -187,7 +188,7 @@ include("head.inc"); <tr> <td width="22%" valign="top" class="vncellreq"><?=gettext("Count"); ?></td> <td width="78%" class="vtable"> - <?=$mandfldhtml;?><input name="count" type="text" class="formfld" id="count" size="10" value="<?=htmlspecialchars($pconfig['count']);?>"> + <?=$mandfldhtml;?><input name="count" type="text" class="formfld" id="count" size="10" value="<?=htmlspecialchars($pconfig['count']);?>" /> <br /> <span class="vexpl"><?=gettext("Enter the number of vouchers"); ?> (1..<?=htmlspecialchars($maxcount);?>) <?=gettext("found on top of the generated/printed vouchers. WARNING: Changing this number for an existing Roll will mark all vouchers as unused again"); ?>.</span> </td> @@ -195,7 +196,7 @@ include("head.inc"); <tr> <td width="22%" valign="top" class="vncell"><?=gettext("Comment"); ?></td> <td width="78%" class="vtable"> - <?=$mandfldhtml;?><input name="descr" type="text" class="formfld" id="descr" size="60" value="<?=htmlspecialchars($pconfig['descr']);?>"> + <?=$mandfldhtml;?><input name="descr" type="text" class="formfld" id="descr" size="60" value="<?=htmlspecialchars($pconfig['descr']);?>" /> <br /> <span class="vexpl"><?=gettext("Can be used to further identify this roll. Ignored by the system"); ?>.</span> </td> @@ -203,13 +204,15 @@ include("head.inc"); <tr> <td width="22%" valign="top"> </td> <td width="78%"> - <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>"> - <input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>"> + <input name="Submit" type="submit" class="formbtn" value="<?=gettext("Save"); ?>" /> + <input name="zone" type="hidden" value="<?=htmlspecialchars($cpzone);?>" /> <?php if (isset($id) && $a_roll[$id]): ?> - <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>"> + <input name="id" type="hidden" value="<?=htmlspecialchars($id);?>" /> <?php endif; ?> </td> </tr> </table> </form> <?php include("fend.inc"); ?> +</body> +</html>
\ No newline at end of file |