Failed to execute template. Cause: [Access denied when checking [script] access to [xwiki:Collaboratory.UX.HbpSkin.WebHome] for user [xwiki:XWiki.Admin]]. Click on this message for details.

Query Users - HBP Wiki

IAM21 instance, do not create collab nor modify a team, your changes will be lost


Changes for page Query Users

Last modified by bougault on 2023/09/28 17:01

From version 11.3
edited by bougault
on 2023/09/28 14:13
Change comment: There is no comment for this version
To version 6.1
edited by bougault
on 2022/12/20 14:49
Change comment: There is no comment for this version

Summary

Details

Page properties
Content
... ... @@ -2,20 +2,18 @@
2 2  #set($query = $services.query.xwql("from doc.object(XWiki.XWikiUsers) as users"))
3 3  #set($users = $query.execute())
4 4  #set($warnings = [])
5 -#set($userIds = [])
6 6  #foreach($userId in $users)
7 7   #set($userDoc = $xwiki.getDocument($userId))
8 8   #set($obj = $userDoc.getObject("XWiki.XWikiUsers"))
9 9   #set($lastName = $obj.get("last_name"))
10 10   #if(!$lastName.matches('[A-Z]{1}\.'))
11 - $warnings.add("user $userId lastname does not match privacy rules")
10 + #set($warnings = $warnings.add("user $userId lastname does not match privacy rules"))
12 12   #end
12 +
13 13   #set($email = $obj.getValue("email"))
14 14   #if($email != "")
15 - $warnings.add("user $userId email does not match privacy rules")
15 + #set($warnings = $warnings.add("user $userId email does not match privacy rules"))
16 16   #end
17 - $zaza = $obj.getValue("user_name")
18 - $userIds.add("x = $zaza")
19 19  #end
20 20  {{/velocity}}
21 21  
... ... @@ -22,15 +22,6 @@
22 22  {{velocity}}
23 23  
24 24  {{html clean="false"}}
25 -<ul>
26 -#foreach($warning in $warnings)
27 - <li>$warning</li>
28 -#end
29 -</ul>
30 -<ul>
31 -#foreach($user in $userIds)
32 - <li>$user</li>
33 -#end
34 -</ul>
23 +$warnings
35 35  {{/html}}
36 36  {{/velocity}}