no i need to know how many users are logged in , am trying to use the
auth_event table to track the login and logout events but still i can get
it to work like i want, something like this :


def online():
    online_users = []
    for i in db().select(db.auth_event.ALL):
        get_event = (i.description).split(' ')
        if get_event[2] == 'Logged-in':
           online_users.append(i.user_id)
        elif get_event[2] == 'Logged-out':
           if i.user_id in online_users:
               for n in online_users:
                   if n == i.user_id:
                       online_users.remove(i.user_id)

Best Regards,


On Wed, Dec 12, 2012 at 4:19 PM, Massimo Di Pierro <
[email protected]> wrote:

> Big can of worms. How do you define the users online? If you mean the
> users who currently have a page open on your site, then you must use
> websockets. Look into this:
>
> gluon/contrib/websocket_messaging.py
>
> You need to start it (requires tornado) and look into the file. There is
> an example of JS to embed in pages so that they establish a websocket when
> loaded.
>
>
>
>
> On Wednesday, 12 December 2012 07:06:46 UTC-6, Hassan Alnatour wrote:
>>
>> Dear ALL,
>>
>> How can i get the online users in my site ?
>>
>> Best Regards,
>>
>  --
>
>
>
>

-- 



Reply via email to