/** * Lock a user setting it's locked_at to actual time. * * @return bool */ public function lock_access() { $this->locked_at = \Date::time('UTC')->format('mysql'); if ($this->is_unlock_strategy_enabled('email')) { $this->generate_unlock_token(); } // Revoke authentication token $this->authentication_token = null; // Save and make sure session is destroyed completely if ($this->save(false) && Warden::logout(true)) { // Only send instructions after token was saved successfully if ($this->is_unlock_strategy_enabled('email')) { return $this->send_unlock_instructions(); } return true; } return false; }
public function action_logout() { Warden::logout(); Response::redirect('/welcome'); }