Jump to:

23375 Posts in 18175 Topics by 2866 members

General Questions

SilverStripe Forums » General Questions » Limit member logins to one

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 446 Views
  • martbarr
    Avatar
    Community Member
    46 Posts

    Limit member logins to one Link to this post

    Hi,

    I need a way of allowing one login at a time per user.
    This is to deliver a commercial system where concurrent logins are not alloweddue to licensing.
    I realise it will only be accurate to 15 mins - and I am not using the forum module (yet!).

    Anyone point me the right way please?

    Thanks
    Martin

  • martbarr
    Avatar
    Community Member
    46 Posts

    Re: Limit member logins to one Link to this post

    Hm looking aroud I can see that the "last visited" time is within the last 15 mins.

    So could I use a CustomMemberLoginForm that checks that the member's last visited time is older than 15mins before trying doLogin(), else deny them with a "too many users logged in with this username message" ??

    Is it this simple?
    Martin

  • martbarr
    Avatar
    Community Member
    46 Posts

    Re: Limit member logins to one Link to this post

    No-one ??

  • Willr
    Avatar
    Forum Moderator
    5489 Posts

    Re: Limit member logins to one Link to this post

    I think you had it correct with your last post. Have a custom doLogin that checks to see whether that person is already logged in and if so deny the login. It's impossible really to accurately say whether a user is logged in with SilverStripe, so the level of complexity depends on your commerical needs. A basic CSRF pattern (which may work for you) is storing the users IP, computer hostname string in the database and anything else you could get that is unique to that workstation and make sure that if a user is logging in within a 15min period that it comes from the same details.

    446 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.