Modifiche per il documento Utenti

Dalla versione 8.1
modificato da Andrea Omicini
il 2026/08/29 00:57
Cambia il commento: Nessun commento per questa versione
Alla versione 9.1
modificato da Andrea Omicini
il 2026/08/29 01:11
Cambia il commento: Nessun commento per questa versione

Summary

Details

Page properties
Content
... ... @@ -5,7 +5,8 @@
5 5  ## Nothing is hand-maintained here: the groups are the values declared by
6 6  ## XWiki.XWikiUsers.status, in the class's own order, and every user carrying a
7 7  ## status appears in exactly one of them. Add a status to the class and it shows
8 -## up here; change someone's status and they move.
8 +## up here; change someone's status and they move. Disabled accounts (active = 0)
9 +## are left out.
9 9  ##
10 10  ## Headings use the translation keys XWiki.XWikiUsers_status_<value>, so the page
11 11  ## is bilingual without a single string of its own.
... ... @@ -24,7 +24,9 @@
24 24   #set( $uDoc = $xwiki.getDocument($ref) )
25 25   #set( $uObj = $uDoc.getObject('XWiki.XWikiUsers') )
26 26   #set( $st = "$!uObj.getValue('status')" )
27 - #if( $people.containsKey($st) && !$seen.contains($ref) )
28 + ## `active` is unset on most user objects, so only an explicit 0 counts as disabled
29 + #set( $isActive = ("$!uObj.getValue('active')" != '0') )
30 + #if( $people.containsKey($st) && $isActive && !$seen.contains($ref) )
28 28   #set( $discard = $seen.add($ref) )
29 29   ## sort key: surname, then given name, then the reference
30 30   #set( $last = "$!uObj.getValue('last_name')" )
... ... @@ -45,7 +45,7 @@
45 45   #if( $group && !$group.isEmpty() )
46 46   #set( $group = $collectiontool.sort($group) )
47 47  
48 ->$services.localization.render("XWiki.XWikiUsers_status_${status}") (%%)//($group.size())//
51 +>$services.localization.render("XWiki.XWikiUsers_status_${status}")
49 49  
50 50   #foreach( $entry in $group )#if( !$foreach.first ) • #end#apicePerson($entry)#end
51 51  
... ... @@ -77,3 +77,4 @@
77 77  
78 78  #end
79 79  {{/velocity}}
83 +