Skip to content

Instantly share code, notes, and snippets.

@dreadfullyposh
Last active December 17, 2015 02:38
Show Gist options
  • Save dreadfullyposh/5536957 to your computer and use it in GitHub Desktop.
Save dreadfullyposh/5536957 to your computer and use it in GitHub Desktop.
Login module code
/*
* So, basically you'd set this type of function up as an action ID in an EE module
*
*/
function process_login(){
// Some sort of verfication would happen here, either session variables or an encrypted key, etc. something to
// prove that the request is valid.
if(!(some validation scheme) && (also validate that you have a member id to login))
{
exit;
}
else
{
// Create a new session for the user (second param is whether it's an admin session or not)
$this->EE->session->create_new_session($member_id, TRUE);
$url = $this->EE->config->item('cp_url'); // or could be frontend url
$this->EE->functions->redirect($url);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment