From 75ec9245d2f5fa2f528d63ac3bffab385363aca1 Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Thu, 14 Sep 2023 08:53:00 -0500 Subject: [PATCH] ADAuthorizer auth skip count entry fixes #15304 --- LibreNMS/Authentication/ADAuthorizationAuthorizer.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LibreNMS/Authentication/ADAuthorizationAuthorizer.php b/LibreNMS/Authentication/ADAuthorizationAuthorizer.php index 40ab8f40d21e..4695b7b5eba2 100644 --- a/LibreNMS/Authentication/ADAuthorizationAuthorizer.php +++ b/LibreNMS/Authentication/ADAuthorizationAuthorizer.php @@ -112,7 +112,11 @@ public function getRoles(string $username): array|false // collect all roles $auth_ad_groups = Config::get('auth_ad_groups'); - foreach ($entries[0]['memberof'] as $entry) { + foreach ($entries[0]['memberof'] as $index => $entry) { + if ($index == 'count') { + continue; // skip count entry + } + $group_cn = $this->getCn($entry); if (isset($auth_ad_groups[$group_cn]['roles']) && is_array($auth_ad_groups[$group_cn]['roles'])) {