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

Using vanilla authentication for non vanilla pages

edited May 2007 in Vanilla 1.0 Help
Hi, What I'm trying to do is use the vanilla login to give users access to various areas of my site. I've got so far with this but now I've really hit a brick wall, and I'm not sure what to do next. It works in my root folder, but for some reason as soon as I try to do it from another folder it dies. Specifically, it always thinks your not logged in even when you are. This problem occurs in the root as well if a full address (http://...) is used in the includes. The code I'm using to see if a user is logged in is: include_once("./forum/appg/settings.php"); include_once("./forum/appg/init_people.php"); if ($Context->Session->UserID > 0) { //Person is logged in } else { //Person is not logged in } I'd be very grateful for any advice on what's going on here. Jimmy

Comments

  • Options
    I'd really appreciate any help on this,I'm completely stuck at the moment. I'm pretty certain I've searched this forum and the documentation for any help. No doubt this is just my total lack of technical understanding coming through, but I don't where to look next. Cheers, Jimmy
  • Options
    If you do it from another folder, you'll need to change your include's

    e.g.

    root:
    include_once("./forum/appg/settings.php");
    include_once("./forum/appg/init_people.php");

    root/subfolder
    include_once("../forum/appg/settings.php");
    include_once("../forum/appg/init_people.php");

    root/subfolder/subfolder
    include_once("../../forum/appg/settings.php");
    include_once("../../forum/appg/init_people.php");

    Good luck :)
  • Options
    I still seem to have a similar problem. If I sign in vanilla then go to my index page it correctly checks to see if the person is signed in or not, however in doing so it seems to destroy the session. If you go back to the forum it reports you as not signed in. However if you sign in on my index page (which directs users to forum/people.php?ReturnUrl=http://www...) isn't recognised if you then go on the forum. Could this be connected with using $UserID = $_SESSION['LussumoUserID']; to detect the name of the user? This problem is begining to get me down! Cheers, jimmy
This discussion has been closed.