From 429471b4f41259f19aec9c8264c4267f7bcefbac Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Tue, 1 Feb 2022 19:31:06 -0500 Subject: [PATCH] add aggregate 'groups_list' attribute for connecting to the member forum --- lib/Auth/Source/FSFDrupalAuth.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/lib/Auth/Source/FSFDrupalAuth.php b/lib/Auth/Source/FSFDrupalAuth.php index 3ef7b88..6695cc0 100644 --- a/lib/Auth/Source/FSFDrupalAuth.php +++ b/lib/Auth/Source/FSFDrupalAuth.php @@ -293,6 +293,24 @@ class FSFDrupalAuth extends \SimpleSAML\Module\core\Auth\UserPassBase } } } + + // + // aggregate attribute + // + + $groups_list = ''; + $first = true; + foreach ($attributes as $key => $value) { + if ($value == ['true']) { + if (!$first) { + $groups_list .= ', '; + } + $groups_list .= $key; + $first = false; + } + } + + $attributes['groups_list'] = [$groups_list]; } /** -- 2.25.1