db::escape($email) ]); if(!$user) throw new Exception(__("Account not found.")); if(!password_verify($password, $user->password)) throw new Exception(__("Password is incorrect.")); if(!$user->activated) { $user->sendActivationEmail(); throw new Exception(__("Your email address is not verified. An activation email has been sent to your email address.")); } $_SESSION["user_id"] = $user->id; $redirect = $_SESSION["log_in_redirect_uri"] ?? "/account"; Core::addAlert("success", __("Log in successful.")); HTTP::redirect($redirect); } catch(Exception $e) { Core::addAlert("danger", $e->getMessage()); } } View::includeOnce("header", compact("page_title")); View::include("log_in"); View::includeOnce("footer"); ?>