Hi Gerritjan, On 12/10/2010 10:23 PM, Gerritjan Koekkoek wrote:
Hi,
I'm looking to build a script that will delete all registered users from our XWiki that did not complete the registration by replying to the email and look like SPAM registration (firstname = lastname) The property of the object of XWiki.XWikiUsers -> active (of type boolean) is false
Now this is my first attempt to HQL and i need some help #foreach($result in $xwiki.search(" select distinct doc.fullName, prop.value from XWikiDocument as doc, BaseObject as obj, StringProperty as prop, BooleanProperty as acti where obj.className='XWiki.XWikiUsers' and obj.name=doc.fullName and prop.id.id=obj.id and prop.name='first_name' and prop.value is not empty and prop.value in ( select prop.value from StringProperty as prop2 where prop2.id.id=obj.id and prop2.name='last_name' and prop2.value=prop.value) and acti.id.id=obj.id and acti.name='active' and acti.value=false ")) * $result.get(0) - $result.get(1) #end
BooleanProperty is a wild guess of me looking at StringProperty as a example The query should look for users where first-name = last-name and active is false If possible I would like to check if the document creation date/time is more then 8 hours old
I guess you've seen http://extensions.xwiki.org/xwiki/bin/view/Extension/Delete+Spam+Users but you missed http://extensions.xwiki.org/xwiki/bin/view/Extension/List+Inactive+Users . Shouldn't be hard to combine them. Hope this helps, Marius
Gerritjan
_______________________________________________ users mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/users