AuthBackendController: Fix `Variable '$backend' is probably undefined`

This commit is contained in:
Sukhwinder Dhillon 2023-08-16 10:00:11 +02:00 committed by raviks789
parent d8fe09f368
commit eeff32d4ce
1 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,7 @@ class AuthBackendController extends CompatController
*/ */
protected function getUserBackend($name = null, $interface = 'Icinga\Data\Selectable') protected function getUserBackend($name = null, $interface = 'Icinga\Data\Selectable')
{ {
$backend = null;
if ($name !== null) { if ($name !== null) {
$config = Config::app('authentication'); $config = Config::app('authentication');
if (! $config->hasSection($name)) { if (! $config->hasSection($name)) {
@ -121,6 +122,7 @@ class AuthBackendController extends CompatController
*/ */
protected function getUserGroupBackend($name = null, $interface = 'Icinga\Data\Selectable') protected function getUserGroupBackend($name = null, $interface = 'Icinga\Data\Selectable')
{ {
$backend = null;
if ($name !== null) { if ($name !== null) {
$config = Config::app('groups'); $config = Config::app('groups');
if (! $config->hasSection($name)) { if (! $config->hasSection($name)) {