Jump to:

5540 Posts in 1738 Topics by 1224 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Silverstripe Login & Other Sites

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

Page: 1
Go to End
Author Topic: 386 Views
  • Parker1090
    Avatar
    Community Member
    38 Posts

    Silverstripe Login & Other Sites Link to this post

    Hello!

    I have 2 systems running side by side, but they're using 2 different log in systems. One's a custom built system (PHP), running at for example, 'customscript.example.com', and then SilverStripe running at example.com.

    I want to integrate these 2 going into the new year, but only in terms of user log ins. So, how easy would it be to use the SilverStripe log in forms and methods to log into both systems at once? Where on Earth do I start with this?

    Thanks in advance!

  • Willr
    Avatar
    Forum Moderator
    5503 Posts

    Re: Silverstripe Login & Other Sites Link to this post

    Depends how your custom system is built and what you want to use as your 'source' database and your slave. I would recommend SilverStripe be your master. In that case you need to push any SS logins to your custom app. SilverStripe does give you a hook to do this in Member 'memberLoggedIn' (https://github.com/silverstripe/silverstripe-framework/blob/3.1/security/Member.php#L401) which you could push the login state too. To get users for custom.example.com to login to the main app you could try link them to example.com/Security/login?BackURL=http://custom.example.com

    if you want to use it as a slave then SilverStripe includes an ability to log users in programmatically which you could write a script for.

    $member = Member::get()->filter('Email', 'will@mail.com');
    $member->logIn();

  • Parker1090
    Avatar
    Community Member
    38 Posts

    Re: Silverstripe Login & Other Sites Link to this post

    Thanks Will. I would use SilverStripe as the master database, so I'll give the 'BackURL' a go.

    Any problems, I'll be back!

  • Parker1090
    Avatar
    Community Member
    38 Posts

    Re: Silverstripe Login & Other Sites Link to this post

    Looking into this now, and just curious - how would I know if a log in is successful, and who is logged in just by using the SilverStripe form? Is there a post variable used?

    As it's going from main to sub domain, the cookie isn't transferred, so just trying to get this to link up.

    386 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.