Re: 2 questions about LiveUser
| From: | Matthias Nothhaft | Date: | Tue, 07 Sep 2010 14:13:29 +0000 |
| Subject: | Re: 2 questions about LiveUser | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-53773@lists.php.net to get a copy of this message | ||
Am 07.09.2010 00:39, schrieb Axel S:
> Hello!
>
> I have successfully set up auth/permission using LiveUser as a base.
> Works great, thanks!
>
> Although the package hasn't been updated for some time, I hope there are
> some LU-fans on the list that can help me sort out a few questions =)
As it is old PHP 4 code I would not use it anymore.. but if it is ok for
you then it's ok for me ;-)
> 1.
> I do not want one user to be able to be logged in from multiple
> computers/sessions simultanously. Say one username is logged in on
> computer 1, and the same username logs in from computer 2. Then would
> like computer 1 to be automatically logged off. Is this possible to
> achieve?
This is a bit tricky.. I would create a table to be able to mark a user
as "online" maybe with the IP adress. Then you can check this on login
and lock the login if already logged in from another IP. If you want an
automatic logout on computer 1 you need to track what session(id)s a
user has with the IP adress and simply delete the session(s) that no not
belong to the current IP. But you have to implement everything yourself
as it's not part of LiveUser.
> 2.
> As a security measure I want to log successful and unsuccessful
> logins/logouts to a mysql table (handle, date/time, ip, event). I am not
> so familiar with PEAR, and have tried to configure the Log and Event
> Dispatcher classes for this, with no luck. Any suggestions on how to get
> this configuration to work?
You need to create a table and "manually" insert records on submit of
the login form. I don't know of any way to automatically do this using
Log/Event_Dispatcher.
regards,
Matthias