diff options
author | Ermal <eri@pfsense.org> | 2010-05-28 18:38:41 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2010-05-28 18:38:41 +0000 |
commit | fac13a5eb382ce8773e6897d06d28e06abe07179 (patch) | |
tree | 3ff60b435f61c2b777de9a3cd7efac89476d01fd /etc | |
parent | 4fc68c5aa4f72e930d453266c7bfb166af057b18 (diff) | |
download | pfsense-fac13a5eb382ce8773e6897d06d28e06abe07179.zip pfsense-fac13a5eb382ce8773e6897d06d28e06abe07179.tar.gz |
Add a function to find the mac address on a passthrough mac entry by username(if present) in the <username> tag of the entry.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/inc/captiveportal.inc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/etc/inc/captiveportal.inc b/etc/inc/captiveportal.inc index 48f9dba..7c51201 100644 --- a/etc/inc/captiveportal.inc +++ b/etc/inc/captiveportal.inc @@ -785,6 +785,18 @@ function captiveportal_passthrumac_configure($lock = false) { return $rules; } +function captiveportal_passthrumac_findbyname($username) { + global $config; + + if (is_array($config['captiveportal']['passthrumac'])) { + foreach ($config['captiveportal']['passthrumac'] as $macent) { + if ($macent['username'] == $username) + return $macent; + } + } + return NULL; +} + /* * table (3=IN)/(4=OUT) hold allowed ip's without bw limits * table (5=IN)/(6=OUT) hold allowed ip's with bw limit. |