I have some macros that allow you to get the lists you want.
In the first place, the macro used to prepare the lists. I load this module when needed in [special:begin].
{.comment|------------------------------------------------------------------
macros related to users and groups
creates a list that is easy to use as csv
Note for group naming:
*name = regular group (associated to site, directory)
#name = attribute group (has no acces to anyting, is uses to distinguish
users with special rights or tastes
examples: #auxadm - allowed to add accounts to his regular group(s)
#techie - template shows only to them things like speeds,users conected,downloadcounters etc.
--------------------------------------------------------------------.}
{.set|accgroups|{.get|accounts|groups.}.}
{.set|accusers|{.get|accounts|users.}.}
{.set|tg|{.^accgroups.}.}
{.set|ng|{.add|{.count substring|*|{.^accgroups.}.}|{.count substring|#|{.^accgroups.}.}.}.}
{.set|group|.}
{.for|ii|1|{.^ng.}|
{:
{.set|tg2|{.substring||;|{.^tg.}.}.}{.set|tg|{.replace|{.^tg2.};||{.^tg.}.}.}
{.set append|group|[{.cut|2||{.^tg2.}.}:.}
{.set|tus|{.^accusers.}.}
{.set|nu|{.count substring|;|{.^accusers.}.}.}
{.for|jj|0|{.^nu.}|
{:
{.set|tu2|{.substring||;|{.^tus.}.}.}
{.if|{.member of|{.^tg2.}|user={.^tu2.}.}|{:{.set append |group|{.^tu2.};.}:}.}
{.set|tus|{.replace|{.^tu2.};||{.^tus.}.}.}
:}.}
:}.}
{.set append |group|][not in group:.}
{.set|tus|{.^accusers.}.}
{.for|jj|0|{.^nu.}|
{:
{.set|tu2|{.substring||;|{.^tus.}.}.}{.set|tus|{.replace|{.^tu2.};||{.^tus.}.}.}
{.if not|{.pos|{.^tu2.}|{.^group.}.}|{:{.set append |group|{.^tu2.};.}:}.}
:}.}
{.set append |group|].}
here you have some code to show your lists of user groups in different manners (to be placed or called in the section where you want to show the list in your template):
Total groups:{.^ng.}<br />
Groups: {.^accgroups.}<br />
Users: {.replace|;|, |{.^accusers.}.}<br />
Full list:{.replace|;|, |{.get|accounts.}.}<br />
{.comment| the showcsv.. macros are in a separate macro module.}
{.^showcsvrows|{.replace|[|<br />|{.^group.}.}.}
{.^showcsvtable|{.replace|;| - |{.replace|:|,|{.^group.}.}.}.}
To see better the list or even a table, you can use and adapt to your need the following showcsv.. macros (must also be placed before first use!):
{.set|showcsvrows|{:{.replace|][|]<br />[|$1.}:}.}
{.set|showcsvtable|{:
{.set|ttab|{.replace|]|</td></tr>|$1.}.}
{.set|ttab|{.replace|[|<tr><td nowrap>|{.^ttab.}.}.}
{.set|ttab|{.replace|,|</td><td nowrap>|{.^ttab.}.}.}
<table border="1">{.^ttab.}</table>
:}.}
that's all
