From: jdegraeve Date: Tue, 24 Jan 2006 16:35:16 +0000 (+0000) Subject: Change order of clientmac and radius system and include message that we need better... X-Git-Url: https://git.gsnw.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b3df11f959edc815220880008bd2c9e9e6b7f340;p=m0n0chwall.git Change order of clientmac and radius system and include message that we need better error handling instead of exiting without notifying user. git-svn-id: https://svn.m0n0.ch/wall/trunk@45 e36fee2c-cc09-0410-a7cc-ebac5c6737de --- diff --git a/captiveportal/index.php b/captiveportal/index.php index fc5efc5..4791c56 100644 --- a/captiveportal/index.php +++ b/captiveportal/index.php @@ -71,20 +71,22 @@ if ($_POST['redirurl']) $macfilter = !isset($config['captiveportal']['nomacfilter']); -if (file_exists("{$g['vardb_path']}/captiveportal_radius.db")) { - $radius_enable = TRUE; - if ($radius_enable && isset($config['captiveportal']['radmac_enable'])) - $radmac_enable = TRUE; -} - /* find MAC address for client */ $clientmac = arp_get_mac_by_ip($clientip); if (!$clientmac && $macfilter) { /* unable to find MAC address - shouldn't happen! - bail out */ captiveportal_logportalauth("unauthenticated","noclientmac",$clientip,"ERROR"); + /* We should return an error page to the client explaining what went wrong instead of exiting */ exit; } +/* find out if we need RADIUS + RADIUSMAC or not */ +if (file_exists("{$g['vardb_path']}/captiveportal_radius.db")) { + $radius_enable = TRUE; + if ($radius_enable && isset($config['captiveportal']['radmac_enable'])) + $radmac_enable = TRUE; +} + if ($_POST['logout_id']) { disconnect_client($_POST['logout_id']); echo <<