forked from rDrama/rDrama
fggf
parent
93502b7eff
commit
f18f6be588
|
@ -267,14 +267,6 @@ def sign_up_post(v):
|
||||||
email = email.strip()
|
email = email.strip()
|
||||||
if not email: email = None
|
if not email: email = None
|
||||||
|
|
||||||
#counteract gmail username+2 and extra period tricks - convert submitted email to actual inbox
|
|
||||||
if email and email.endswith("@gmail.com"):
|
|
||||||
email=email.split('@')[0]
|
|
||||||
email=email.split('+')[0]
|
|
||||||
email=email.replace('.','')
|
|
||||||
email=f"{email}@gmail.com"
|
|
||||||
|
|
||||||
|
|
||||||
existing_account = get_user(username, graceful=True)
|
existing_account = get_user(username, graceful=True)
|
||||||
if existing_account and existing_account.reserved:
|
if existing_account and existing_account.reserved:
|
||||||
return redirect(existing_account.permalink)
|
return redirect(existing_account.permalink)
|
||||||
|
@ -380,15 +372,18 @@ def post_forgot():
|
||||||
|
|
||||||
email=email.replace("_","\_")
|
email=email.replace("_","\_")
|
||||||
|
|
||||||
if email.endswith("@gmail.com"):
|
user = g.db.query(User).filter(
|
||||||
|
User.username.ilike(username),
|
||||||
|
User.email.ilike(email)).first()
|
||||||
|
|
||||||
|
if not user and email.endswith("@gmail.com"):
|
||||||
email=email.split('@')[0]
|
email=email.split('@')[0]
|
||||||
email=email.split('+')[0]
|
email=email.split('+')[0]
|
||||||
email=email.replace('.','')
|
email=email.replace('.','')
|
||||||
email=f"{email}@gmail.com"
|
email=f"{email}@gmail.com"
|
||||||
|
user = g.db.query(User).filter(
|
||||||
user = g.db.query(User).filter(
|
User.username.ilike(username),
|
||||||
User.username.ilike(username),
|
User.email.ilike(email)).first()
|
||||||
User.email.ilike(email)).first()
|
|
||||||
|
|
||||||
if user:
|
if user:
|
||||||
# generate url
|
# generate url
|
||||||
|
@ -501,16 +496,15 @@ def request_2fa_disable():
|
||||||
|
|
||||||
|
|
||||||
email=request.form.get("email")
|
email=request.form.get("email")
|
||||||
if email and email.endswith("@gmail.com"):
|
if email != user.email and email.endswith("@gmail.com"):
|
||||||
email=email.split('@')[0]
|
email=email.split('@')[0]
|
||||||
email=email.split('+')[0]
|
email=email.split('+')[0]
|
||||||
email=email.replace('.','')
|
email=email.replace('.','')
|
||||||
email=f"{email}@gmail.com"
|
email=f"{email}@gmail.com"
|
||||||
|
if email != user.email:
|
||||||
if email != user.email:
|
return render_template("message.html",
|
||||||
return render_template("message.html",
|
title="Removal request received",
|
||||||
title="Removal request received",
|
message="If username, password, and email match, we will send you an email.")
|
||||||
message="If username, password, and email match, we will send you an email.")
|
|
||||||
|
|
||||||
|
|
||||||
password =request.form.get("password")
|
password =request.form.get("password")
|
||||||
|
|
|
@ -240,15 +240,8 @@ def settings_security_post(v):
|
||||||
escape("Invalid password."))
|
escape("Invalid password."))
|
||||||
|
|
||||||
new_email = request.form.get("new_email","").strip()
|
new_email = request.form.get("new_email","").strip()
|
||||||
#counteract gmail username+2 and extra period tricks - convert submitted email to actual inbox
|
|
||||||
if new_email.endswith("@gmail.com"):
|
|
||||||
gmail_username=new_email.split('@')[0]
|
|
||||||
gmail_username=gmail_username.split("+")[0]
|
|
||||||
gmail_username=gmail_username.replace('.','')
|
|
||||||
new_email=f"{gmail_username}@gmail.com"
|
|
||||||
if new_email == v.email:
|
if new_email == v.email:
|
||||||
return redirect("/settings/security?error=" +
|
return redirect("/settings/security?error=That email is already yours!")
|
||||||
escape("That email is already yours!"))
|
|
||||||
|
|
||||||
# check to see if email is in use
|
# check to see if email is in use
|
||||||
existing = g.db.query(User).filter(User.id != v.id,
|
existing = g.db.query(User).filter(User.id != v.id,
|
||||||
|
|
Loading…
Reference in New Issue