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 = |=User|=Phone|=Email #set($users = $xwiki.rightsmanager.usersApi.allUsersNames) #foreach($user in $users) #if($xwiki.getUser($user).isUserInGroup($group)) #set($phone = $xwiki.getDocument($user).getObject('XWiki.XWikiUsers').getProperty('phone').getValue()) #set($email = $xwiki.getDocument($user).getObject('XWiki.XWikiUsers').getProperty('email').getValue()) |$xwiki.getUserName($user)|$phone|$email #end #end #end {{/html}} {{/velocity}} -- View this message in context: http://xwiki.475771.n2.nabble.com/How-could-I-get-the-user-s-phone-using-his-her-username-tp7590488p7590494.html Sent from the XWiki- Users mailing list archive at Nabble.com. _______________________________________________ users mailing list users@xwiki.org http://lists.xwiki.org/mailman/listinfo/users