Try this:
{{velocity}}
{{html wiki='true'}}
<form action="$doc.getURL()" method="post">
<input type="hidden" name="action" value="get_users"
/>
<div>Select usergroup
<select name="group">
#set($rightsAPI=$xwiki.rightsmanager)
#set($groupsAPI=$rightsAPI.getGroupsApi())
#set($groups=$groupsAPI.getAllLocalGroupsNames())
#foreach($group in $groups)
<option value="$group">$group</option>
#end
</select>
<input type="submit" value="Show users"/></div>
</form>
{{/html}}
{{html wiki='true'}}
#if($request.action == 'get_users')
#set($group=$request.group)
= Users in $group =
#set($users = $xwiki.rightsmanager.usersApi.allUsersNames)
#foreach($user in $users)
#if($xwiki.getUser($user).isUserInGroup($group))
<div>$xwiki.getUserName($user)</div>
#end
#end
#end
{{/html}}
{{/velocity}}
--
View this message in context:
http://xwiki.475771.n2.nabble.com/Retrieve-the-list-of-users-based-on-the-s…
Sent from the XWiki- Dev mailing list archive at
Nabble.com.