From 9b6dc9535ccb1d8ea1d01fac6cc4e61b6f71b823 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Thu, 4 Feb 2016 18:08:52 +0100 Subject: [PATCH] (captive portal) send auth messages to syslog --- .../OPNsense/CaptivePortal/Api/AccessController.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/opnsense/mvc/app/controllers/OPNsense/CaptivePortal/Api/AccessController.php b/src/opnsense/mvc/app/controllers/OPNsense/CaptivePortal/Api/AccessController.php index 8ba9e3f5b..1bb1553c3 100644 --- a/src/opnsense/mvc/app/controllers/OPNsense/CaptivePortal/Api/AccessController.php +++ b/src/opnsense/mvc/app/controllers/OPNsense/CaptivePortal/Api/AccessController.php @@ -161,6 +161,7 @@ class AccessController extends ApiControllerBase } if ($isAuthenticated) { + $this->getLogger("captiveportal")->info("AUTH " . $userName . " (".$clientIp.") zone " . $zoneid); // when authenticated, we have $authServer available to request additional data if needed $clientSession = $this->clientSession((string)$cpZone->zoneid); if ($clientSession['clientState'] == 'AUTHORIZED') { @@ -202,6 +203,7 @@ class AccessController extends ApiControllerBase } } } else { + $this->getLogger("captiveportal")->info("DENY " . $userName . " (".$clientIp.") zone " . $zoneid); return array("clientState" => 'NOT_AUTHORIZED', "ipAddress" => $clientIp); } } @@ -236,6 +238,9 @@ class AccessController extends ApiControllerBase ); $status = json_decode($statusRAW, true); if ($status != null) { + $this->getLogger("captiveportal")->info( + "LOGOUT " . $clientSession['userName'] . " (".$this->getClientIp().") zone " . $zoneid + ); return $status; } }