Search code examples
phpmysqlinvision-power-board

Web-site and Invision Power same login


I have a website.com with a custom login class and in a subdomain forum2.website.com i have installed IPBoard 3.8. With a script I insert existing users into forum table members an forum login works well. Now I want to bind to the login system. If I login to the website, then I go on forum page I want it recognize me as logged in. What are params and/or cookies to set? Do I also have to create a row in a table named session? I try setting these:

setcookie( "member_id"   , id,0);
setcookie( "pass_hash"   , pass_hash,0);
setcookie( "ipsconnect_" . md5( 'url' ), '1', 0, 0, FALSE, FALSE );

Solution

  • IPBoard provides you with the Single Sign-On capability (SSO).

    Single sign on is an oft-needed capability with IP.Board, allowing a website to tie the forums into their existing login structure without modifying core IP.Board files and retaining the customizations following upgrades. IP.Board natively supports SSO functionality through two separate plugin files."

    If you scroll down to "Method 2: Extending the session class", you will see an example of implementation of a custom class to check if the users are connected on your website - by looking at cookies or whatever else you want.

    Basically, you're verifying with IPB that you are connected on your website, you don't have to manually create the session variables to "fool" IPB in thinking that you logged in through the "usual" method - ie the forum itself.