I’m trying to write an extension so as to validate user against an external database, but I’m stuck. Here’s the code:
function member_member_login_start() //This function is called on event "member_member_login_start"
{
// QUERY FOR VALIDATING THE USER
// USER IS VALIDATED FROM EXT DB SUCCESSFULLY
if ($user_info['authenticated'])
{
echo "auhtneicated";
print_r($this->EE->session->userdata);
exit;
}
else
{
exit('User authentication failed.');
}
}So my questions are:
Even though I get a message user is authenticated successfully (EE message), the user details are not set in the EE session. When I print the user session array, it shows empty member_id and other fields. Do I need to set user data in session in my code?
How can I display the “authentication failed” message in the regular EE message box that comes if I enter wrong login details in normal scenario?
Where & how to use $EXT->end_script = TRUE; I saw it in docs but couldn’t understand how it is used?
Moved to Development and Programming by Moderator
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.