From 67df0e95c45fe142cc9db6997bf73a39a7bfbe06 Mon Sep 17 00:00:00 2001 From: Son NK Date: Tue, 9 Apr 2024 13:34:57 +0200 Subject: [PATCH] user can turn on/off the data breach check --- app/dashboard/views/setting.py | 15 +++++++++ templates/dashboard/setting.html | 52 +++++++++++++++++++++++++++++--- 2 files changed, 63 insertions(+), 4 deletions(-) diff --git a/app/dashboard/views/setting.py b/app/dashboard/views/setting.py index cefbaf58..857905ab 100644 --- a/app/dashboard/views/setting.py +++ b/app/dashboard/views/setting.py @@ -227,6 +227,21 @@ def setting(): Session.commit() flash("Your preference has been updated", "success") return redirect(url_for("dashboard.setting")) + elif request.form.get("form-name") == "enable_data_breach_check": + if not current_user.is_premium(): + flash( + "Only premium plan can add enable data breach monitoring", "warning" + ) + return redirect(url_for("dashboard.setting")) + choose = request.form.get("enable_data_breach_check") + if choose == "on": + current_user.enable_data_breach_check = True + flash("Data breach monitoring is enabled", "success") + else: + current_user.enable_data_breach_check = False + flash("Data breach monitoring is disabled", "info") + Session.commit() + return redirect(url_for("dashboard.setting")) elif request.form.get("form-name") == "sender-in-ra": choose = request.form.get("enable") if choose == "on": diff --git a/templates/dashboard/setting.html b/templates/dashboard/setting.html index 03403766..ab6d865c 100644 --- a/templates/dashboard/setting.html +++ b/templates/dashboard/setting.html @@ -249,6 +249,42 @@ + +
+
+
Data breach monitoring
+
+ {% if not current_user.is_premium() %} + + + {% endif %} + If enabled, we will inform you via email if one of your aliases appears in a data breach. +
+ SimpleLogin uses HaveIBeenPwned API for checking for data breaches. +
+
+ {{ csrf_form.csrf_token }} + +
+ + +
+ +
+
+
+
@@ -285,7 +321,9 @@ No Name (i.e. only reverse-alias) - +
@@ -295,7 +333,9 @@
Reverse Alias Replacement -
Experimental
+
+ Experimental +
When replying to a forwarded email, the reverse-alias can be automatically included @@ -312,9 +352,13 @@ name="replace-ra" {% if current_user.replace_reverse_alias %} checked{% endif %} class="form-check-input"> - +
- +