diff options
author | mgrooms <mgrooms@shrew.net> | 2009-03-15 00:31:55 +0000 |
---|---|---|
committer | mgrooms <mgrooms@shrew.net> | 2009-03-15 00:39:19 +0000 |
commit | 0092b3bd47bdfa8b3bc24e140235e4693918ee46 (patch) | |
tree | 1618c52053505a6eb015e0a683fa5e95b2e1ecfc /usr/local/captiveportal | |
parent | d1d1e96136b30e0069474d8c204feca6c9e25985 (diff) | |
download | pfsense-0092b3bd47bdfa8b3bc24e140235e4693918ee46.zip pfsense-0092b3bd47bdfa8b3bc24e140235e4693918ee46.tar.gz |
Modify captive portal to use centralized user management. The user manager has
been modified to include an account expiration option to support this service.
Diffstat (limited to 'usr/local/captiveportal')
-rwxr-xr-x | usr/local/captiveportal/index.php | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/usr/local/captiveportal/index.php b/usr/local/captiveportal/index.php index 22384bf..011095a 100755 --- a/usr/local/captiveportal/index.php +++ b/usr/local/captiveportal/index.php @@ -28,6 +28,7 @@ POSSIBILITY OF SUCH DAMAGE. */ +require_once("auth.inc"); require_once("functions.inc"); header("Expires: 0"); @@ -135,33 +136,8 @@ EOD; } else if ($_POST['accept'] && $config['captiveportal']['auth_method'] == "local") { - //check against local usermanager - $userdb = &$config['captiveportal']['user']; - - $loginok = false; - - //erase expired accounts - if (is_array($userdb)) { - $moddb = false; - for ($i = 0; $i < count($userdb); $i++) { - if ($userdb[$i]['expirationdate'] && (strtotime("-1 day") > strtotime($userdb[$i]['expirationdate']))) { - unset($userdb[$i]); - $moddb = true; - } - } - if ($moddb) - write_config(); - - $userdb = &$config['captiveportal']['user']; - - for ($i = 0; $i < count($userdb); $i++) { - if (($userdb[$i]['name'] == $_POST['auth_user']) && ($userdb[$i]['password'] == md5($_POST['auth_pass']))) { - $loginok = true; - break; - } - } - } - + //check against local user manager + $loginok = local_backed($_POST['auth_user'], $_POST['auth_pass']); if ($loginok){ captiveportal_logportalauth($_POST['auth_user'],$clientmac,$clientip,"LOGIN"); portal_allow($clientip, $clientmac,$_POST['auth_user']); @@ -415,4 +391,4 @@ function disconnect_client($sessionid, $logoutReason = "LOGOUT", $term_cause = 1 captiveportal_unlock(); } -?>
\ No newline at end of file +?> |