Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: dimensionmedia on August 29, 2006, 07:45:44 PM

Title: Only Allowing One User To Use Their Account At One Time
Post by: dimensionmedia on August 29, 2006, 07:45:44 PM
Long story why I need this, but it's important (to me).

I'm trying to prevent people from using the same account in SMF ***AT THE SAME TIME****, or "sharing" their account. I haven't found anything like this so far on my search in SMF boards.

I looked over the who.template and login.template (where i think is where the action SHOULD happen - it should check to see if the member is ALREADY logged in and active and if so, not allow the "double" in). I'm sure I can run some sort of SQL query for this but (1) anyone know how possible this is with any potential drawbacks, and (2) what's the best SQL statement to write for something like this (obviously the log table is involved).

Thanks in advance. Any pointers would be helpful.
Title: Re: Only Allowing One User To Use Their Account At One Time
Post by: Bigguy on August 29, 2006, 07:49:06 PM
I don`t have any ideas for you but that one you have is a good one. Although as an Administrator of a couple forums I feel the need to be logged in twice at the same time so I think Admins should be exempt from this.
Title: Re: Only Allowing One User To Use Their Account At One Time
Post by: dimensionmedia on August 29, 2006, 10:08:33 PM
Yes, that does make sense.

If anyone can at least point me in the right direction (with code, sql, and/or php), i'm willing to do some dirty work (although I would think exempting admins wouldn't THAT more difficult if you could this to work at all). I believe this is possible because the data EXISTS already in the database.
Title: Re: Only Allowing One User To Use Their Account At One Time
Post by: dimensionmedia on August 31, 2006, 12:25:19 PM
Anyone experiment with the WHO templates/code? That might give me a clue. Thanks.