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.
$Username, $Password, $PersistentSession => There are variables which should be filled. Try adding:
$Username = "test";
$Password = "test";
$PersistentSession = "1";
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?
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)?
Comments
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 = "test"; $Password = "test"; $PersistentSession = "1";
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.