Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Question about Mark's wordpress article

edited November 2006 in Vanilla 1.0 Help
I'm stealing some ideas from Mark's wordpress integration (but using it for my site, not wordpress). I don't need Vanilla to sign people in, and I see he recommends just deleting the people.php file. However my question is how do I get vanilla to use my auth system (as in, if session does not exist, redirect to my login page) and also, what session do I need to set when using my login so that vanilla sees the session as set and the user logged in. I guess my question is: what does vanilla check for to see if a user is logged in.. and what would I need to set? sorry if this is confusing.. but any help would be greatly appreciated


  • Options
    MarkMark Vanilla Staff
    You can make Vanilla redirect to your page using the following configuration parameter:

    $Configuration['SAFE_REDIRECT'] = '/path/to/your/auth/module.php';

    You can also set the "sign in" and "sign out" links on the top right of the page with the following config params:

    $this->Context->Configuration['SIGNIN_URL'] = '/path/to/your/auth/module.php'; $this->Context->Configuration['SIGNOUT_URL'] = '/path/to/your/de-auth/module.php';

    The rest of your questions are really covered in the document. You can create your own authentication module that uses whatever methods necessary to get the user's UserID and pass it out of the authentication module. It doesn't matter what you put into the sessions in your app - as long as vanilla can use that info to get the user's UserID and return it.
  • Options
    edited October 2006
    This is breaking my heart. I have a site with a lot of users and i'd rather simply get vanilla to pick up the existing session, username and password rather than trying to integrate in a more fundamental/wordpress fashion.

    I've changed conf/settings to point to my Authentication Module, and login/out:

    $Configuration['AUTHENTICATION_MODULE'] = 'myAuth.php'; $Configuration['SAFE_REDIRECT'] = 'myAuth.php'; $Configuration['SIGNIN_URL'] = 'mylogin.php'; $Configuration['SIGNOUT_URL'] = 'myLogout.php';

    And I mapped to my database and fields in conf/database.php and added the remaining Vanilla user fields to myUserTable:

    $DatabaseTables['User'] = 'myUserTable'; $DatabaseColumns['User']['UserID'] = 'myUserId'; $DatabaseColumns['User']['Name'] = 'myUserName'; $DatabaseColumns['User']['Password'] = 'myUserPassword';
    When passing from a logged in session from my site into Vanilla, the session is kept and the details are available to the page. But where in Vanilla do I map these details to? Vanilla simply brings up the forum not signed in.

    I can't get my head around using my session login and where Vanilla goes looking for an existing session? I've looked at the Authenticator class but to see if I can write something based on that but its cookies etc. I feel like I just need to inject the available details into one place and It'll all work but I'm a little out of my league to know where to start injecting, so to speak.
  • Options
    MarkMark Vanilla Staff
    You need to make Vanilla understand how you set up your sessions and cookies. You do that by writing your own authentication module and telling Vanilla to use that one instead of the default one. You need to make a copy of the default one (library/People/People.Class.Authenticator.php) named whatever you want, and follow the same interface (make yours have the same property and method names) but make your methods retrieve the information the same way your application does. Without telling Vanilla how your sessions work, there's no way it can get the session information. This is all covered in the integration document.
  • Options
    edited November 2006
    Hey, I noticed that when registering through Vanilla's register screen, you're shown as Anonymous on the Wordpress blog. No problems if you register through Wordpress though, so I'm taking people.php out, thanks for the redirect code Mark ^^ EDIT: Nevermind, I realised I forgot to activate the WordpressIntegration extension. ;_;
This discussion has been closed.