From f323310174f7321be0d1fc7e5e910360568b7767 Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Fri, 24 Feb 2017 15:29:05 +0100 Subject: [PATCH] DbUserBackend: don't fail at validation if there aren't any active users refs #2598 --- library/Icinga/Authentication/User/DbUserBackend.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/library/Icinga/Authentication/User/DbUserBackend.php b/library/Icinga/Authentication/User/DbUserBackend.php index b0eb95f69..6d6e11c52 100644 --- a/library/Icinga/Authentication/User/DbUserBackend.php +++ b/library/Icinga/Authentication/User/DbUserBackend.php @@ -285,12 +285,7 @@ class DbUserBackend extends DbRepository implements UserBackendInterface, Inspec $insp = new Inspection('Db User Backend'); $insp->write($this->ds->inspect()); try { - $users = $this->select()->where('is_active', true)->count(); - if ($users > 0) { - $insp->write(sprintf('%s active users', $users)); - } else { - return $insp->error('0 active users', $users); - } + $insp->write(sprintf('%s active users', $this->select()->where('is_active', true)->count())); } catch (Exception $e) { $insp->error(sprintf('Query failed: %s', $e->getMessage())); }