+ """
+
+ text = Format(text)
+
+ Send(user.get("email", ""), "Verification Code", text)
+
+ Render.send(server, html, 200)
+
+ else:
+
+ # If we recieved the code.
+
+ if code not in verifying:
+ print("code not in verifying")
+ Render.AccessDenied(server)
+ return
+
+
+ if verifying[code] != user.get("email"):
+ print("email wrong")
+ Render.AccessDenied(server)
+ return
+
+ user["email_verified"] = True
+
+ f = Set.Folder()
+ folder = f+"/accounts"
+ with open(folder+"/"+user.get("username", "")+".json", "w") as save:
+ json.dump(user, save, indent=4)
+
+ Render.Redirect(server, "/settings#email")
+
+def Format(text):
+
+ config = Set.Load()
+
+ favicon = config.get("favicon", "")
+ if favicon.startswith("/"):
+ favicon = "https://"+config.get("domain", "")+favicon
+
+ css = open(config.get("css", "default.css"), "r")
+ html = ''
+ html = html + '
'
+
+ if favicon:
+ html = html + ''
+
+ html = html + " "+config.get("title", "My Website")
+ html = html + "
"
+ html = html + '
'
+ html = html + text
+ html = html + '
'
+
+ return html
+
+
diff --git a/modules/Help.py b/modules/Help.py
index 3afe605..d7d717a 100644
--- a/modules/Help.py
+++ b/modules/Help.py
@@ -33,6 +33,7 @@ def Set():
print(clr["tdyl"]+"--tagline"+clr["norm"]+" - Set tagline of the website.")
print(clr["tdyl"]+"--domain"+clr["norm"]+" - Let the server know the clearnet domain.")
print(clr["tdyl"]+"--tor"+clr["norm"]+" - Let the server know the tor domain.")
+ print(clr["tdyl"]+"--email"+clr["norm"]+" - Set Email SMTP account for internal automatic messages.")
print(clr["tdyl"]+"--port"+clr["norm"]+" - Set port where to run the website.")
print(clr["tdyl"]+"--css"+clr["norm"]+" - Set a CSS file.")
print(clr["tdyl"]+"--css_edit"+clr["norm"]+" - edit a CSS file.")
diff --git a/modules/Render.py b/modules/Render.py
index f38c629..8307b14 100644
--- a/modules/Render.py
+++ b/modules/Render.py
@@ -747,6 +747,8 @@ def AccountPage(server, account):
html = html + '
'
html = html + ''
html = html + ' '+email+''
+ if Accounts.get(account, {}).get("email_verified"):
+ html = html + ''
html = html + '
"""
if redirect:
@@ -1110,9 +1119,44 @@ def SettingsPage(server):
-
+
"""
+ if user.get("email"):
+
+ if not user.get("email_verified"):
+ html = html + """
+
+
Email Settings
+
+
+ Email """+Safe(user.get("email"))+""" is not verified.
+