add aggregate 'groups_list' attribute
authorAndrew Engelbrecht <andrew@fsf.org>
Wed, 2 Feb 2022 00:31:06 +0000 (19:31 -0500)
committerroot <root@login1p.fsf.org>
Wed, 2 Feb 2022 00:31:06 +0000 (19:31 -0500)
for connecting to the member forum

lib/Auth/Source/FSFDrupalAuth.php

index 3ef7b88ddc3b211c99b00355dd6bc6c67c782ac9..6695cc0b854830671494f498913b7212de96ae95 100644 (file)
@@ -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];
     }
 
     /**