cogExports users of the wiki in CSV format
Developed by

Thibaut Camberlin

Rating
Rate!
0 Votes
LicenseGNU Lesser General Public License 2.1

Description

Copy / paste this code in a page and you'll be able to download the users of your wiki in CSV format

{{velocity}}
#if("$!{request.confirm}" == '1')
  #set($ok = $response.setContentType("text/csv"))
  #set($ok = $response.setHeader("Content-disposition", "attachment; filename=export-users.csv"))
login;firstname;lasname;email;phone
  #set ($sql = ", BaseObject as obj where obj.name = doc.fullName and obj.className = 'XWiki.XWikiUsers' and obj.name <> 'XWiki.XWikiUserTemplate' order by doc.name asc")
  #foreach($user in $xwiki.searchDocuments($sql))
    #set($userDoc = $xwiki.getDocument($user))
"$userDoc.name";"$userDoc.get('first_name')";"$userDoc.get('last_name')";"$userDoc.getValue('email')";"$userDoc.get('phone')"
  #end
#else
  * [[Download CSV list of users>>?confirm=1&xpage=plain&outputSyntax=plain]]
  * [[Download CSV list of users (link if xwiki 2.1 syntax)>>||queryString="confirm=1&xpage=plain&outputSyntax=plain"]]
#end
{{/velocity}}

Prerequisites & Installation Instructions

Copy the code snippet to a page and save it.

Created by Thibaut Camberlin on 2010/09/30 09:51
     

Get Connected