Last active
December 17, 2015 02:38
-
-
Save dreadfullyposh/5536957 to your computer and use it in GitHub Desktop.
Login module code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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