Not logged in. · Lost password · Register
Forum: agsXMPP RSS
Avatar
irokhes #1
Member since Mar 2012 · 16 posts
Group memberships: Members
Show profile · Link to this post
Subject: Get users last login
Hi,

i´m trying to get last login from a list of users. I´ve tried differents configurations but none of them work.

SEND: <iq id="prueba2" type="set" to="servername" from="admin@servername/agsXMPP">
<command xmlns="http://jabber.org/protocol/commands" node="http://jabber.org/protocol/admin#get-user-lastlogin" sessionid="2012-03-28T06:49:07.621419Z">
<x xmlns="jabber:x:data" type="submit">
<field type="hidden" var="FORM_TYPE">
<value>http://jabber.org/protocol/admin
</value>
</field>
<field var="accountjid" type="jid-multi">
<value>user3@servername</value>
<value>user1@servername</value>
</field></x></command></iq>
RECV: <iq xmlns="jabber:client" to="admin@servername/agsXMPP" id="prueba2" type="result" from="servername"><command xmlns="http://jabber.org/protocol/commands" sessionid="2012-03-28T06:49:07.621419Z" status="completed" node="http://jabber.org/protocol/admin#get-user-lastlogin">
<x xmlns="jabber:x:data" type="result">
<field var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/admin</value>
</field>
<field label="Jabber ID" type="jid-single" var="accountjid">
<value>user3@servername</value>
</field>
<field label="Last login" type="text-single" var="lastlogin">
<value>Online</value>
</field>
</x>
</command>
</iq>

If type var="accountjids" instead of accountjid a error appears

SEND: <iq id="prueba2" type="set" to="servername" from="admin@servername/agsXMPP">
<command xmlns="http://jabber.org/protocol/commands" node="http://jabber.org/protocol/admin#get-user-lastlogin" sessionid="2012-03-28T06:49:07.621419Z">
<x xmlns="jabber:x:data" type="submit">
<field type="hidden" var="FORM_TYPE">
<value>http://jabber.org/protocol/admin</value>
</field>
<field var="accountjids" type="jid-multi">
<value>user3@servername</value>
<value>user1@servername</value>
</field>
</x>
</command>
</iq>
RECV:
<iq xmlns="jabber:client" to="qadmin@qprocxmpp/agsXMPP" id="prueba2" type="error" from="servername">
<command xmlns="http://jabber.org/protocol/commands" node="http://jabber.org/protocol/admin#get-user-lastlogin" sessionid="2012-03-28T06:49:07.621419Z">
<x xmlns="jabber:x:data" type="submit">
<field var="FORM_TYPE" type="hidden">
<value>http://jabber.org/protocol/admin</value>
</field>
<field var="accountjids" type="jid-multi">
<value>user3@servername</value>
<value>user1@servername</value>
</field>
</x>
</command>
<error type="modify" code="400"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas" /></error>
</iq>


Thanks!!
Avatar
Alex #2
Member since Feb 2003 · 4297 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
the data form of your server has only the accountjid field. You cannot add a multi jid fields accountjids when the server id not prepared for this and does not offer it.

And as you can see your first Xml log is correct and the server reports that the user is Online right now. So I don't see where the problem is. If the user is offline the server should report the last log out timesptamp.

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: agsXMPP RSS