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.

How to use People

2»

Comments

  • I have decided to build my own login system which uses Vanilla's user table and mimics the sessions and cookies. So far it seems to be working well. Thanks Mark and Bergamot for your help.
  • I am trying to use people in a new Vanilla 1.0 install to authenticate access to a test PHP page.

    From above I am using (error checking removed):

    <?php include_once("./appg/settings.php"); include_once("./appg/init_people.php"); $Ret = $Context->Authenticator->Authenticate($Username, $Password, $PersistentSession); ?> <html><head><title>Test login</title></head><body> <h1>Test login</h1> <p>Welcome, you are logged in</p> </body></html>

    and I get the errors:

    Notice: Undefined variable: Username in test2.php on line 11 Notice: Undefined variable: Password in test2.php on line 11 Notice: Undefined variable: PersistentSession in test2.php on line 11

    I'm obviously not understanding the basics here, but if anyone feels liking taking pity, can they point to a basic tutorial on people please?

    The objective here is to use Vanilla authentication on a custom-built PHP CMS.

    Thanks in advance.

  • $Username, $Password, $PersistentSession => There are variables which should be filled. Try adding:
    $Username = "test"; $Password = "test"; $PersistentSession = "1";
  • OK, this works - thanks.

    So this is a method of providing username/password from my application and authenticating against the Vanilla users. In other words, I'd build a form in my application?

    What I'd like to know is how to get people to provide the login box, so I can use all the existing people functions like password reminder etc.

    Can I call a function in people that checks if the user is logged in, displays a box if not, and redirects to the page being authenticated?

    Thanks again.
  • Why dont you just use the full people library (which will provide you with the login box etc) then just have your application check for the cookie (with part of people if you want)?
This discussion has been closed.