summaryrefslogtreecommitdiffstats
path: root/etc/inc/voucher.inc
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@pfsense.org>2010-08-24 10:45:29 -0400
committerScott Ullrich <sullrich@pfsense.org>2010-08-24 10:45:29 -0400
commitc14d996776df164d83f34845e423715bf97ba764 (patch)
treebbeb388bdf36961344c086a1281bec3222b177a3 /etc/inc/voucher.inc
parent5f250a244a33abc9e791239ba2c2ad9f6737045b (diff)
downloadpfsense-c14d996776df164d83f34845e423715bf97ba764.zip
pfsense-c14d996776df164d83f34845e423715bf97ba764.tar.gz
Resolve issue where used variable might be an array (multiple voucher rolls)
Diffstat (limited to 'etc/inc/voucher.inc')
-rw-r--r--etc/inc/voucher.inc13
1 files changed, 10 insertions, 3 deletions
diff --git a/etc/inc/voucher.inc b/etc/inc/voucher.inc
index e7012cb..056172b 100644
--- a/etc/inc/voucher.inc
+++ b/etc/inc/voucher.inc
@@ -145,9 +145,16 @@ function voucher_auth($voucher_received, $test = 0) {
// All given vouchers were valid and this isn't simply a test.
// Write back the used DB's
- if (is_array($bitstring))
- foreach ($bitstring as $roll => $used)
- voucher_write_used_db($roll, base64_encode($used));
+ if (is_array($bitstring)) {
+ foreach ($bitstring as $roll => $used) {
+ if(is_array($used)) {
+ foreach($used as $u)
+ voucher_write_used_db($roll, base64_encode($u));
+ } else {
+ voucher_write_used_db($roll, base64_encode($used));
+ }
+ }
+ }
// Active DB: we only add the first voucher if multiple given
// and give that one all the time credit. This allows the user to logout and
OpenPOWER on IntegriCloud