Custom loginform -what is the minimum amount of vanilla-code that needs to be included?
I wish to log-in users both on my main site and in to vanilla as well. They are sharing usertables at the moment; added the nessesary fields for vanilla as outlined in Marcs Wordpress integration tutorial and mapped the fields in conf/database.php I had hoped to go the easy way an not write a custom autentication module for vanilla, delete the people.php fiel and force users to login via the main site. I searched the people.php and the includes in that file but i can't find where the $_POST['username] & $_POST['password] gets piked up by an instantsiated People.Class.Authenticator object. Tryed "find in files": "Authenticate" without any luck. Only get referenses to the Authenticator classes but cant seeme to find any referense to the metod in outher parts of the app. What am I missing. The problem is surly due to my laking uderstanding of Vanillas "templating" system that i dont realy get as off know. Every thing seems to be driven from the Context object. I hope this issent stupid simple and that I have missed the obvious. Some pointers to spare my lengthy digging in source would be mutch appresiated.
0
This discussion has been closed.
Comments
Vanilla use ForceIncomingString, ForceIncomingInt and ForceIncomingBool to get the POST and GET values. Check in Framework.Functions.php to know what they do.
include('appg/settings.php'); include('appg/init_ajax.php'); $Username = ; $Password = ; $Persistant = ; $Errors = array( -2 => 'Fatal database error', -1 => 'Insufficient permissions', 0 => 'Username/password combination not found', ); $Ret = $Context->Authenticator->Authenticate($Username, $Password, $Persistant); if($Ret <= 0) echo($Errors[$Ret]);(obviously modifying directories and variable assignments as needed)However, if you've already verified the username and password and have retrieved the verification key, than it'd be simpler (read: more efficient) to call Authenticator::AssignSessionUserID and, if required, ::SetCookieCredentials. You'd probably also want to make a call to ::UpdateLastVisit, but it won't really hurt if you don't.