From e868dc56d893c749f75667aa97336cc6c028bddb Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 28 Oct 2015 09:24:15 +0000 Subject: [PATCH] (auth, legacy) proper error handling --- src/etc/inc/auth.inc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/etc/inc/auth.inc b/src/etc/inc/auth.inc index 288326ee9..72c27f7e2 100644 --- a/src/etc/inc/auth.inc +++ b/src/etc/inc/auth.inc @@ -727,5 +727,10 @@ function authenticate_user($username, $password, $authcfg = NULL) { $authFactory = new OPNsense\Auth\AuthenticationFactory; $authenticator = $authFactory->get($authName); - return $authenticator->authenticate($username, $password) ; + if ($authenticator != null) { + return $authenticator->authenticate($username, $password) ; + } else { + log_error('Unable to retrieve authenticator for '. $authName); + return false; + } }