mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix voucher test and expire pages. Fixes #7939
This commit is contained in:
parent
c5a3368303
commit
0b2d15478e
@ -57,13 +57,11 @@ $pglinks = array("", "status_captiveportal.php", "status_captiveportal.php?zone=
|
||||
|
||||
include("head.inc");
|
||||
|
||||
if ($_POST['save']) {
|
||||
if ($_POST['vouchers']) {
|
||||
if (voucher_expire($_POST['vouchers'])) {
|
||||
print_info_box(gettext('Voucher(s) successfully marked.'), 'success', false);
|
||||
} else {
|
||||
print_info_box(gettext('Voucher(s) could not be processed.'), 'danger', false);
|
||||
}
|
||||
if ($_POST['Submit'] && $_POST['vouchers']) {
|
||||
if (voucher_expire(trim($_POST['vouchers']))) {
|
||||
print_info_box(gettext('Voucher(s) successfully marked.'), 'success', false);
|
||||
} else {
|
||||
print_info_box(gettext('Voucher(s) could not be processed.'), 'danger', false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -58,21 +58,19 @@ $shortcut_section = "captiveportal-vouchers";
|
||||
|
||||
include("head.inc");
|
||||
|
||||
if ($_POST['save']) {
|
||||
if ($_POST['vouchers']) {
|
||||
$test_results = voucher_auth($_POST['vouchers'], 1);
|
||||
$output = "";
|
||||
$class = 'warning';
|
||||
if ($_POST['Submit'] && $_POST['vouchers']) {
|
||||
$test_results = voucher_auth(trim($_POST['vouchers']), 1);
|
||||
$output = "";
|
||||
$class = 'warning';
|
||||
|
||||
foreach ($test_results as $result) {
|
||||
$output .= htmlspecialchars($result) . '<br />';
|
||||
foreach ($test_results as $result) {
|
||||
$output .= htmlspecialchars($result) . '<br />';
|
||||
|
||||
if (strpos($result, " good ") || strpos($result, " granted ")) {
|
||||
$class = 'success';
|
||||
}
|
||||
if (strpos($result, " good ") || strpos($result, " granted ")) {
|
||||
$class = 'success';
|
||||
}
|
||||
print_info_box($output, $class, false);
|
||||
}
|
||||
print_info_box($output, $class, false);
|
||||
}
|
||||
|
||||
$tab_array = array();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user