summaryrefslogtreecommitdiffstats
path: root/etc/inc
diff options
context:
space:
mode:
authorErmal <eri@pfsense.org>2011-06-07 17:15:41 +0000
committerErmal <eri@pfsense.org>2011-06-07 17:15:41 +0000
commite64c894f56b32e603c5e5b1d72bdee40b4876755 (patch)
tree51bda0eb9dd6806c3dc960bc517629fe30bdec22 /etc/inc
parentf989aa5b837cb15d4abcca3ba05c66481a6b1176 (diff)
downloadpfsense-e64c894f56b32e603c5e5b1d72bdee40b4876755.zip
pfsense-e64c894f56b32e603c5e5b1d72bdee40b4876755.tar.gz
Allow a second optional argument to captiveportal_read_db to be able to index the read db by the field in the db.
Diffstat (limited to 'etc/inc')
-rw-r--r--etc/inc/captiveportal.inc4
1 files changed, 2 insertions, 2 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc
index cd07d65..711b2d4 100644
--- a/etc/inc/captiveportal.inc
+++ b/etc/inc/captiveportal.inc
@@ -1195,7 +1195,7 @@ function radius($username,$password,$clientip,$clientmac,$type) {
}
/* read captive portal DB into array */
-function captiveportal_read_db($locked = false) {
+function captiveportal_read_db($locked = false, $index = 5 /* sessionid by default */) {
global $g;
$cpdb = array();
@@ -1209,7 +1209,7 @@ function captiveportal_read_db($locked = false) {
if ($line) {
$cpe = explode(",", $line);
/* Hash by session id */
- $cpdb[$cpe[5]] = $cpe;
+ $cpdb[$cpe[$index]] = $cpe;
}
}
fclose($fd);
OpenPOWER on IntegriCloud