summaryrefslogtreecommitdiffstats
path: root/usr/local/www/services_captiveportal_vouchers.php
diff options
context:
space:
mode:
Diffstat (limited to 'usr/local/www/services_captiveportal_vouchers.php')
-rw-r--r--usr/local/www/services_captiveportal_vouchers.php16
1 files changed, 13 insertions, 3 deletions
diff --git a/usr/local/www/services_captiveportal_vouchers.php b/usr/local/www/services_captiveportal_vouchers.php
index 203906a..f5af953 100644
--- a/usr/local/www/services_captiveportal_vouchers.php
+++ b/usr/local/www/services_captiveportal_vouchers.php
@@ -39,6 +39,8 @@
$statusurl = "status_captiveportal_vouchers.php";
$logurl = "diag_logs_auth.php";
+if ($_POST['postafterlogin'])
+ $nocsrf= true;
require("guiconfig.inc");
require("functions.inc");
require("filter.inc");
@@ -116,9 +118,8 @@ if ($_GET['act'] == "del") {
exit;
}
}
-
/* print all vouchers of the selected roll */
-if ($_GET['act'] == "csv") {
+else if ($_GET['act'] == "csv") {
$privkey = base64_decode($config['voucher']['privatekey']);
if (strstr($privkey,"BEGIN RSA PRIVATE KEY")) {
$fd = fopen("{$g['varetc_path']}/voucher.private","w");
@@ -164,6 +165,12 @@ $pconfig['vouchersyncusername'] = $config['voucher']['vouchersyncusername'];
if ($_POST) {
unset($input_errors);
+
+ if ($_POST['postafterlogin']) {
+ voucher_expire($_POST['voucher_expire']);
+ exit;
+ }
+
$pconfig = $_POST;
/* input validation */
@@ -199,6 +206,8 @@ if ($_POST) {
$input_errors[] = gettext("This doesn't look like an RSA Public key.");
if ($_POST['privatekey'] && (!strstr($_POST['privatekey'],"BEGIN RSA PRIVATE KEY")))
$input_errors[] = gettext("This doesn't look like an RSA Private key.");
+ if ($_POST['vouchersyncdbip'] && (is_ipaddr_configured($_POST['vouchersyncdbip'])))
+ $input_errors[] = gettext("You cannot sync the voucher database to this host (itself).");
}
if (!$input_errors) {
@@ -559,7 +568,8 @@ function enable_change(enable_change) {
<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']);?>">
- <br><?=gettext("IP address of master nodes webConfigurator to synchronize voucher database and used vouchers from."); ?>
+ <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>
</tr>
<tr>
OpenPOWER on IntegriCloud