// If found, verify password against the stored hash. if (user_VerifyPassword($password, $hash)) { // Success! // user_StartSession(false); user_DoLogin($response['id']); user_EndSession(); // TODO: Clear login attempt cache // } else { my_LoginError(); } // ** Successfully Logged in ** // // Retrieve my info // // Retrieve my list of Favourites, and a list of most recent posts I've loved. // } else { if ($action === 'logout') { user_Start(); user_DoLogout(); // Destroy session } else { if ($action === 'register') { // Add a user (if legal), send a verification e-mail. } else { if ($action === 'verify') { // Verify a previously added user given a verification URL. } else { if ($action === 'resend') { // Resend verification e-mail. } else { if ($action === 'lost-password') { // Send a password recovery e-mail. } else {
function user_StartEnd($force_regen = false, $preserve_token = false) { user_Start($force_regen, $preserve_token); user_End(); }