aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wqflask/wqflask/templates/new_security/forgot_password_step2.html11
-rw-r--r--wqflask/wqflask/templates/new_security/registered.html13
-rw-r--r--wqflask/wqflask/templates/new_security/thank_you.html18
-rw-r--r--wqflask/wqflask/templates/new_security/verified.html32
-rw-r--r--wqflask/wqflask/templates/security/_macros.html39
-rw-r--r--wqflask/wqflask/templates/security/_menu.html15
-rw-r--r--wqflask/wqflask/templates/security/_messages.html9
-rw-r--r--wqflask/wqflask/templates/security/_scripts.html3
-rw-r--r--wqflask/wqflask/templates/security/change_password.html11
-rw-r--r--wqflask/wqflask/templates/security/email/change_notice.html4
-rw-r--r--wqflask/wqflask/templates/security/email/change_notice.txt5
-rw-r--r--wqflask/wqflask/templates/security/email/confirmation_instructions.html5
-rw-r--r--wqflask/wqflask/templates/security/email/confirmation_instructions.txt5
-rw-r--r--wqflask/wqflask/templates/security/email/login_instructions.html5
-rw-r--r--wqflask/wqflask/templates/security/email/login_instructions.txt5
-rw-r--r--wqflask/wqflask/templates/security/email/reset_instructions.html1
-rw-r--r--wqflask/wqflask/templates/security/email/reset_instructions.txt3
-rw-r--r--wqflask/wqflask/templates/security/email/reset_notice.html1
-rw-r--r--wqflask/wqflask/templates/security/email/reset_notice.txt1
-rw-r--r--wqflask/wqflask/templates/security/email/welcome.html9
-rw-r--r--wqflask/wqflask/templates/security/email/welcome.txt9
-rw-r--r--wqflask/wqflask/templates/security/forgot_password.html9
-rw-r--r--wqflask/wqflask/templates/security/login_user.html72
-rw-r--r--wqflask/wqflask/templates/security/register_user.html75
-rw-r--r--wqflask/wqflask/templates/security/reset_password.html15
-rw-r--r--wqflask/wqflask/templates/security/send_confirmation.html34
-rw-r--r--wqflask/wqflask/templates/security/send_login.html9
-rw-r--r--wqflask/wqflask/templates/security/thank_you.html8
-rw-r--r--wqflask/wqflask/user_manager.py37
29 files changed, 23 insertions, 440 deletions
diff --git a/wqflask/wqflask/templates/new_security/forgot_password_step2.html b/wqflask/wqflask/templates/new_security/forgot_password_step2.html
index 1295e589..888dcad4 100644
--- a/wqflask/wqflask/templates/new_security/forgot_password_step2.html
+++ b/wqflask/wqflask/templates/new_security/forgot_password_step2.html
@@ -1,14 +1,9 @@
{% extends "base.html" %}
{% block title %}Register{% endblock %}
{% block content %}
- <header class="jumbotron subhead" id="overview">
- <div class="container">
- <h1>Password Reset</h1>
- <p class="lead">
- Check your email.
- </p>
- </div>
- </header>
+
+ {{ header("Password Reset", "Check your email.") }}
+
<div class="container">
<div class="page-header">
diff --git a/wqflask/wqflask/templates/new_security/registered.html b/wqflask/wqflask/templates/new_security/registered.html
index 49dc961f..5c2b2347 100644
--- a/wqflask/wqflask/templates/new_security/registered.html
+++ b/wqflask/wqflask/templates/new_security/registered.html
@@ -1,21 +1,14 @@
{% extends "base.html" %}
{% block title %}Register{% endblock %}
{% block content %}
- <header class="jumbotron subhead" id="overview">
- <div class="container">
- <h1>Thank you</h1>
- <p class="lead">
- Thanks for verifying.
- </p>
- </div>
- </header>
+ {{ header("Almost Done", "Thanks for registering")}
<div class="container">
<div class="page-header">
<h3>One last step</h3>
</div>
-
- <p>You will receive an email with the subject <strong>"{{ subject }}"</strong>.</p>
+
+ <p>You will receive an email with the subject <strong>{{ subject }}</strong>.</p>
<p>You must click the link in the email to complete registration.</p>
diff --git a/wqflask/wqflask/templates/new_security/thank_you.html b/wqflask/wqflask/templates/new_security/thank_you.html
index 97cb7807..7d1018a5 100644
--- a/wqflask/wqflask/templates/new_security/thank_you.html
+++ b/wqflask/wqflask/templates/new_security/thank_you.html
@@ -1,32 +1,24 @@
{% extends "base.html" %}
{% block title %}Register{% endblock %}
{% block content %}
- <header class="jumbotron subhead" id="overview">
- <div class="container">
- <h1>Thank you</h1>
- <p class="lead">
- Thanks for verifying.
- </p>
- </div>
- </header>
+ {{ header("Thank you", "Thanks for verifying") }}
<div class="container">
<div class="page-header">
<h3>You are done registering</h3>
</div>
-
+
<p>Enjoy using the site.</p>
-
+
<p>Go to the <a href="{{ url_for("index_page") }}">homepage</a></p>.
</div>
{% endblock %}
-{% block js %}
+{% block js %}
<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>-->
-
+
{% include "new_security/_scripts.html" %}
<script type="text/javascript" src="/static/new/js_external/zxcvbn/zxcvbn-async.js"></script>
<script type="text/javascript" src="/static/new/javascript/password_strength.js"></script>
{% endblock %}
-
diff --git a/wqflask/wqflask/templates/new_security/verified.html b/wqflask/wqflask/templates/new_security/verified.html
deleted file mode 100644
index 97cb7807..00000000
--- a/wqflask/wqflask/templates/new_security/verified.html
+++ /dev/null
@@ -1,32 +0,0 @@
-{% extends "base.html" %}
-{% block title %}Register{% endblock %}
-{% block content %}
- <header class="jumbotron subhead" id="overview">
- <div class="container">
- <h1>Thank you</h1>
- <p class="lead">
- Thanks for verifying.
- </p>
- </div>
- </header>
-
- <div class="container">
- <div class="page-header">
- <h3>You are done registering</h3>
- </div>
-
- <p>Enjoy using the site.</p>
-
- <p>Go to the <a href="{{ url_for("index_page") }}">homepage</a></p>.
- </div>
-
-{% endblock %}
-
-{% block js %}
- <!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>-->
-
- {% include "new_security/_scripts.html" %}
- <script type="text/javascript" src="/static/new/js_external/zxcvbn/zxcvbn-async.js"></script>
- <script type="text/javascript" src="/static/new/javascript/password_strength.js"></script>
-{% endblock %}
-
diff --git a/wqflask/wqflask/templates/security/_macros.html b/wqflask/wqflask/templates/security/_macros.html
deleted file mode 100644
index ee662ae6..00000000
--- a/wqflask/wqflask/templates/security/_macros.html
+++ /dev/null
@@ -1,39 +0,0 @@
-{% macro render_field_with_errors(field) %}
- <p>
- {{ field.label }} {{ field(**kwargs)|safe }}
- {% if field.errors %}
- <ul>
- {% for error in field.errors %}
- <li>{{ error }}</li>
- {% endfor %}
- </ul>
- {% endif %}
- </p>
-{% endmacro %}
-
-{% macro render_only_errors(field) %}
- <p>
- <!--{{ field.label }} {{ field(**kwargs)|safe }}-->
- {% if field.errors %}
- <div>
- {% for error in field.errors %}
- {% if error=="Email requires confirmation." %}
- <div class="alert">
- <p>You must confirm your email address before signing in.</p>
- <p>Check your email for confirmation instructions.</p>
- <p>Can't find the email? Check your spam folder.</p>
- <p>Still can't find it? <a class="modalize" href="/confirm">
- Click here to resend.</a></p>
- </div>
- {% else %}
- <div class="alert">{{ error }}</div>
- {% endif %}
- {% endfor %}
- </div>
- {% endif %}
- </p>
-{% endmacro %}
-
-{% macro render_field(field) %}
- <p>{{ field(**kwargs)|safe }}</p>
-{% endmacro %}
diff --git a/wqflask/wqflask/templates/security/_menu.html b/wqflask/wqflask/templates/security/_menu.html
deleted file mode 100644
index 5291f809..00000000
--- a/wqflask/wqflask/templates/security/_menu.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{% if security.registerable or security.recoverable or security.confirmabled %}
-<h2>Menu</h2>
-<ul>
- <li><a href="{{ url_for_security('login') }}">Login</a></li>
- {% if security.registerable %}
- <li><a href="{{ url_for_security('register') }}">Register</a><br/></li>
- {% endif %}
- {% if security.recoverable %}
- <li><a href="{{ url_for_security('forgot_password') }}">Forgot password</a><br/></li>
- {% endif %}
- {% if security.confirmable %}
- <li><a href="{{ url_for_security('send_confirmation') }}">Confirm account</a></li>
- {% endif %}
-</ul>
-{% endif %}
diff --git a/wqflask/wqflask/templates/security/_messages.html b/wqflask/wqflask/templates/security/_messages.html
deleted file mode 100644
index 179d0636..00000000
--- a/wqflask/wqflask/templates/security/_messages.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{%- with messages = get_flashed_messages(with_categories=true) -%}
- {% if messages %}
- <ul class="flashes">
- {% for category, message in messages %}
- <li class="{{ category }}">{{ message }}</li>
- {% endfor %}
- </ul>
- {% endif %}
-{%- endwith %} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/_scripts.html b/wqflask/wqflask/templates/security/_scripts.html
deleted file mode 100644
index 5a453dca..00000000
--- a/wqflask/wqflask/templates/security/_scripts.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<!--<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
-<script language="javascript" type="text/javascript" src="/static/packages/colorbox/jquery.colorbox.js"></script>-->
-<script type="text/javascript" src="/static/new/javascript/login.js"></script>
diff --git a/wqflask/wqflask/templates/security/change_password.html b/wqflask/wqflask/templates/security/change_password.html
deleted file mode 100644
index 8ee3eb73..00000000
--- a/wqflask/wqflask/templates/security/change_password.html
+++ /dev/null
@@ -1,11 +0,0 @@
-{% from "security/_macros.html" import render_field_with_errors, render_field %}
-{% include "security/_messages.html" %}
-<h1>Change password</h1>
-<form action="{{ url_for_security('change_password') }}" method="POST" name="change_password_form">
- {{ change_password_form.hidden_tag() }}
- {{ render_field_with_errors(change_password_form.password) }}
- {{ render_field_with_errors(change_password_form.new_password) }}
- {{ render_field_with_errors(change_password_form.new_password_confirm) }}
- {{ render_field(change_password_form.submit) }}
-</form>
-
diff --git a/wqflask/wqflask/templates/security/email/change_notice.html b/wqflask/wqflask/templates/security/email/change_notice.html
deleted file mode 100644
index d1224cf5..00000000
--- a/wqflask/wqflask/templates/security/email/change_notice.html
+++ /dev/null
@@ -1,4 +0,0 @@
-<p>Your password has been changed.</p>
-{% if security.recoverable %}
-<p>If you did not change your password, <a href="{{ url_for_security('forgot_password', _external=True) }}">click here to reset it</a>.</p>
-{% endif %}
diff --git a/wqflask/wqflask/templates/security/email/change_notice.txt b/wqflask/wqflask/templates/security/email/change_notice.txt
deleted file mode 100644
index e74bd80d..00000000
--- a/wqflask/wqflask/templates/security/email/change_notice.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Your password has been changed
-{% if security.recoverable %}
-If you did not change your password, click the link below to reset it.
-{{ url_for_security('forgot_password', _external=True) }}
-{% endif %}
diff --git a/wqflask/wqflask/templates/security/email/confirmation_instructions.html b/wqflask/wqflask/templates/security/email/confirmation_instructions.html
deleted file mode 100644
index 239f670f..00000000
--- a/wqflask/wqflask/templates/security/email/confirmation_instructions.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<p>Welcome to GeneNetwork!</p>
-
-<p>Please confirm your email through the link below:</p>
-
-<p><a href="{{ confirmation_link }}">Confirm my account</a></p>
diff --git a/wqflask/wqflask/templates/security/email/confirmation_instructions.txt b/wqflask/wqflask/templates/security/email/confirmation_instructions.txt
deleted file mode 100644
index babedd8b..00000000
--- a/wqflask/wqflask/templates/security/email/confirmation_instructions.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Welcome to GeneNetwork!
-
-Please confirm your email through the link below:
-
-{{ confirmation_link }}
diff --git a/wqflask/wqflask/templates/security/email/login_instructions.html b/wqflask/wqflask/templates/security/email/login_instructions.html
deleted file mode 100644
index 45a7cb57..00000000
--- a/wqflask/wqflask/templates/security/email/login_instructions.html
+++ /dev/null
@@ -1,5 +0,0 @@
-<p>Welcome {{ user.email }}!</p>
-
-<p>You can log into your through the link below:</p>
-
-<p><a href="{{ login_link }}">Login now</a></p> \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/email/login_instructions.txt b/wqflask/wqflask/templates/security/email/login_instructions.txt
deleted file mode 100644
index 1364ed65..00000000
--- a/wqflask/wqflask/templates/security/email/login_instructions.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Welcome {{ user.email }}!
-
-You can log into your through the link below:
-
-{{ login_link }} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/email/reset_instructions.html b/wqflask/wqflask/templates/security/email/reset_instructions.html
deleted file mode 100644
index fd0b48d8..00000000
--- a/wqflask/wqflask/templates/security/email/reset_instructions.html
+++ /dev/null
@@ -1 +0,0 @@
-<p><a href="{{ reset_link }}">Click here to reset your password</a></p> \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/email/reset_instructions.txt b/wqflask/wqflask/templates/security/email/reset_instructions.txt
deleted file mode 100644
index 91ac288e..00000000
--- a/wqflask/wqflask/templates/security/email/reset_instructions.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Click the link below to reset your password:
-
-{{ reset_link }} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/email/reset_notice.html b/wqflask/wqflask/templates/security/email/reset_notice.html
deleted file mode 100644
index 536e2961..00000000
--- a/wqflask/wqflask/templates/security/email/reset_notice.html
+++ /dev/null
@@ -1 +0,0 @@
-<p>Your password has been reset</p> \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/email/reset_notice.txt b/wqflask/wqflask/templates/security/email/reset_notice.txt
deleted file mode 100644
index a3fa0b4b..00000000
--- a/wqflask/wqflask/templates/security/email/reset_notice.txt
+++ /dev/null
@@ -1 +0,0 @@
-Your password has been reset \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/email/welcome.html b/wqflask/wqflask/templates/security/email/welcome.html
deleted file mode 100644
index 3cb01ce0..00000000
--- a/wqflask/wqflask/templates/security/email/welcome.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<p>Welcome {{ user.email }}!</p>
-
-<p>We hope you find GeneNetwork an amazing resource!</p>
-
-{% if security.confirmable %}
-<p>You can confirm your email through the link below:</p>
-
-<p><a href="{{ confirmation_link }}">Confirm my account</a></p>
-{% endif %}
diff --git a/wqflask/wqflask/templates/security/email/welcome.txt b/wqflask/wqflask/templates/security/email/welcome.txt
deleted file mode 100644
index 9a400686..00000000
--- a/wqflask/wqflask/templates/security/email/welcome.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-Welcome {{ user.email }}!
-
-We hope you find GeneNetwork an amazing resource!
-
-{% if security.confirmable %}
-You can confirm your email through the link below:
-
-{{ confirmation_link }}
-{% endif %}
diff --git a/wqflask/wqflask/templates/security/forgot_password.html b/wqflask/wqflask/templates/security/forgot_password.html
deleted file mode 100644
index 90fcaf66..00000000
--- a/wqflask/wqflask/templates/security/forgot_password.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% from "security/_macros.html" import render_field_with_errors, render_field %}
-{% include "security/_messages.html" %}
-<h1>Send password reset instructions</h1>
-<form action="{{ url_for_security('forgot_password') }}" method="POST" name="forgot_password_form">
- {{ forgot_password_form.hidden_tag() }}
- {{ render_field_with_errors(forgot_password_form.email) }}
- {{ render_field(forgot_password_form.submit) }}
-</form>
-{% include "security/_menu.html" %} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/login_user.html b/wqflask/wqflask/templates/security/login_user.html
deleted file mode 100644
index bee4e824..00000000
--- a/wqflask/wqflask/templates/security/login_user.html
+++ /dev/null
@@ -1,72 +0,0 @@
-{% from "security/_macros.html" import render_only_errors %}
-{% include "security/_messages.html" %}
-
-<div class="security_box">
-
- <h4>Don't have an account?</h4>
-
- <center>
- <a href="/register" class="btn btn-info modalize">Create a new account</a>
- </center>
-
- <hr />
-
- <h4>Already have an account?</h4>
-
- <h5>Sign in here</h5>
-
- <form class="form-horizontal" action="{{ url_for_security('login') }}"
- method="POST" name="login_user_form">
- {{ login_user_form.hidden_tag() }}
- <fieldset>
-
-
- <div class="control-group">
- {{ render_only_errors(login_user_form.email) }}
- <label class="control-label" for="email">Email Address</label>
- <div class="controls">
- <input id="email" class="focused" name="email" type="text" value="">
- </div>
- </div>
-
- <div class="control-group">
- {{ render_only_errors(login_user_form.password) }}
- <label class="control-label" for="password">Password</label>
- <div class="controls">
- <input id="password" name="password" type="password" value="">
- <br />
-
- {% if security.recoverable %}
-
- <a href="{{ url_for_security('forgot_password') }}">Forgot your password?</a><br/>
- </div>
- {% endif %}
-
- </div>
-
-
- <div class="control-group">
- <div class="controls">
- <label class="checkbox">
- <input id="remember" name="remember" type="checkbox" value="y"> Remember me
- </label>
- </div>
-
-
- <div class="control-group">
- <div class="controls">
- <input id="next" name="next" type="hidden" value="">
-
- <input class="btn btn-primary" id="submit" name="submit" type="submit" value="Sign in">
- </div>
-
-
- </div>
- </fieldset>
-
- </form>
-</div>
-
-
-{% include "security/_scripts.html" %}
-<!--{% include "security/_menu.html" %}-->
diff --git a/wqflask/wqflask/templates/security/register_user.html b/wqflask/wqflask/templates/security/register_user.html
deleted file mode 100644
index 8e6908ff..00000000
--- a/wqflask/wqflask/templates/security/register_user.html
+++ /dev/null
@@ -1,75 +0,0 @@
-{% from "security/_macros.html" import render_only_errors %}
-{% include "security/_messages.html" %}
-
-<div class="security_box">
- <h4>Already have an account?</h4>
-
- <center>
- <a href="/login"
- class="btn btn-info modalize">Sign in using existing account</a>
- </center>
-
- <hr />
-
- <h4>Don't have an account?</h4>
-
- <h5>Register here</h5>
-
- <form class="form-horizontal" action="{{ url_for_security('register') }}"
- method="POST" name="login_user_form">
- {{ register_user_form.hidden_tag() }}
- <fieldset>
-
-
- <div class="control-group">
- <label class="control-label" for="email">Email Address</label>
- <div class="controls">
- <input id="email" name="email" class="focused" type="text" value="">
- </div>
- {{ render_only_errors(register_user_form.email) }}
- </div>
-
- <div class="control-group">
- <label class="control-label" for="email">Name</label>
- <div class="controls">
- <input id="name" name="name" type="text" value="">
- </div>
- </div>
-
- <div class="control-group">
- <label class="control-label" for="email">Organization</label>
- <div class="controls">
- <input id="organization" name="organization" type="text" value="">
- </div>
- </div>
-
- <div class="control-group">
- <label class="control-label" for="password">Password</label>
- <div class="controls">
- <input id="password" name="password" type="password" value="">
- </div>
- {{ render_only_errors(register_user_form.password) }}
- </div>
-
- {% if register_user_form.password_confirm %}
- <div class="control-group">
- <label class="control-label" for="password_confirm">Password</label>
- <div class="controls">
- <input id="password" name="password_confirm" type="password" value="">
- </div>
- {{ render_only_errors(register_user_form.password_confirm) }}
- </div>
- {% endif %}
-
- <div class="control-group">
- <div class="controls"">
- <input class="btn btn-primary" id="submit" name="submit" type="submit" value="Create account">
- </div>
- </div>
-
- </fieldset>
-
- </form>
-</div>
-{% include "security/_scripts.html" %}
-<!--{% include "security/_menu.html" %}-->
diff --git a/wqflask/wqflask/templates/security/reset_password.html b/wqflask/wqflask/templates/security/reset_password.html
deleted file mode 100644
index 76e978cd..00000000
--- a/wqflask/wqflask/templates/security/reset_password.html
+++ /dev/null
@@ -1,15 +0,0 @@
-{% extends "base.html" %}
-{% block title %}Reset Password{% endblock %}
-
-{% block content %}
-{% from "security/_macros.html" import render_field_with_errors, render_field %}
-{% include "security/_messages.html" %}
-<h1>Reset password</h1>
-<form action="{{ url_for_security('reset_password', token=reset_password_token) }}" method="POST" name="reset_password_form">
- {{ reset_password_form.hidden_tag() }}
- {{ render_field_with_errors(reset_password_form.password) }}
- {{ render_field_with_errors(reset_password_form.password_confirm) }}
- {{ render_field(reset_password_form.submit) }}
-</form>
-{% include "security/_menu.html" %}
-{% endblock %} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/send_confirmation.html b/wqflask/wqflask/templates/security/send_confirmation.html
deleted file mode 100644
index 4552c219..00000000
--- a/wqflask/wqflask/templates/security/send_confirmation.html
+++ /dev/null
@@ -1,34 +0,0 @@
-{% extends "base.html" %}
-{% block title %}Send Confirmation{% endblock %}
-{% block content %}
-
-{% from "security/_macros.html" import render_only_errors %}
-{% include "security/_messages.html" %}
-
-<div class="security_box">
- <h4>Resend confirmation instructions</h4>
-
- <form action="{{ url_for_security('send_confirmation') }}"
- method="POST" name="send_confirmation_form">
-
- <fieldset>
- {{ send_confirmation_form.hidden_tag() }}
-
- <div class="control-group">
- <label class="control-label" for="email">Email Address</label>
- <div class="controls">
- <input id="email" name="email" class="focused" type="text" value="">
- </div>
- {{ render_only_errors(send_confirmation_form.email) }}
-
- </div>
-
- <div class="control-group">
- <div class="controls"">
- <input class="btn btn-primary" id="submit" name="submit" type="submit" value="Sign in">
- </div>
- </div>
- </fieldset>
- </form>
-</div>
-{% endblock %} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/send_login.html b/wqflask/wqflask/templates/security/send_login.html
deleted file mode 100644
index 15611c57..00000000
--- a/wqflask/wqflask/templates/security/send_login.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% from "security/_macros.html" import render_field_with_errors, render_field %}
-{% include "security/_messages.html" %}
-<h1>Login</h1>
-<form action="{{ url_for_security('login') }}" method="POST" name="send_login_form">
- {{ send_login_form.hidden_tag() }}
- {{ render_field_with_errors(send_login_form.email) }}
- {{ render_field(send_login_form.submit) }}
-</form>
-{% include "security/_menu.html" %} \ No newline at end of file
diff --git a/wqflask/wqflask/templates/security/thank_you.html b/wqflask/wqflask/templates/security/thank_you.html
deleted file mode 100644
index 1b8de3e5..00000000
--- a/wqflask/wqflask/templates/security/thank_you.html
+++ /dev/null
@@ -1,8 +0,0 @@
-{% from "security/_macros.html" import render_only_errors %}
-{% include "security/_messages.html" %}
-
-<div class="security_box">
- <h4>Thank you for signing in!</h4>
-</div>
-
-<script src="/static/new/javascript/thank_you.js"></script> \ No newline at end of file
diff --git a/wqflask/wqflask/user_manager.py b/wqflask/wqflask/user_manager.py
index 766f49df..70aa111e 100644
--- a/wqflask/wqflask/user_manager.py
+++ b/wqflask/wqflask/user_manager.py
@@ -1,6 +1,7 @@
from __future__ import print_function, division, absolute_import
-"""Access things in template like this:
+"""Used to Access things in template like this:
+(BUT NOW OUT OF DATE)
x: {{ g.identity.name }}
security: {{ security.__dict__ }}
@@ -142,7 +143,7 @@ class RegisterUser(object):
print("No errors!")
- set_password(password, user)
+ set_password(password, self.user)
self.user.registration_info = json.dumps(basic_info(), sort_keys=True)
@@ -228,7 +229,6 @@ class Password(object):
# On our computer it takes around 1.4 seconds in 2013
start_time = time.time()
salt = base64.b64decode(salt)
- print("now salt is:", salt)
self.password = pbkdf2.pbkdf2_hex(str(unencrypted_password),
salt, iterations, keylength, hashfunc)
self.encrypt_time = round(time.time() - start_time, 3)
@@ -328,7 +328,15 @@ def login():
login_rec = model.Login(user)
- if valid:
+ if valid and not user.confirmed:
+ # User needs to confirm before we log them in...
+ flash("You still need to verify your email address."
+ "We've resent the verification email. "
+ "Please check your email and follow the instructions.", "alert-error")
+
+ VerificationEmail(user)
+ return redirect((url_for('login')))
+ elif valid:
login_rec.successful = True
login_rec.session_id = str(uuid.uuid4())
#session_id = "session_id:{}".format(login_rec.session_id)
@@ -408,10 +416,6 @@ def register():
params = None
errors = None
- #if request.form:
- # params = request.form
- #else:
- # params = request.args
params = request.form if request.form else request.args
@@ -496,17 +500,6 @@ def send_email(to, subject, body):
Redis.rpush("mail_queue", msg)
-#def combined_salt(user_salt):
-# """Combine the master salt with the user salt...we use two seperate salts so that if the database is compromised, the
-# salts aren't immediately known"""
-# secret_salt = app.confing['SECRET_SALT']
-# assert len(user_salt) == 32
-# assert len(secret_salt) == 32
-# combined = ""
-# for x, y in user_salt, secret_salt:
-# combined = combined + x + y
-# return combined
-
class GroupsManager(object):
@@ -518,9 +511,3 @@ class RolesManager(object):
def __init__(self):
self.roles = model.Role.query.all()
print("Roles are:", self.roles)
-
-
-#class Password(object):
-# """To generate a master password: dd if=/dev/urandom bs=32 count=1 > master_salt"""
-#
-# master_salt =