예제 #1
0
def fix(msg=''):
    if request.method == 'GET':
        return render_template("fix.html",msg='')
    else:
        uname = request.form['username']
        password = request.form['password']
        if (uname in utils.users()):
            if utils.authenticate(uname, password):
                new_password = request.form['newpass']
                confirm = request.form['confirm']
                if new_password != confirm:
                    return render_template("fix.html", msg="The passwords do not match. Try again")
                elif len(new_password) < 6:
                    return render_template("fix.html", msg="The password must be at least 6 characters")
                else:
                    utils.correct_password(password, new_password)
                    if 'user' in session:
                        session['user'] = ''
                    return redirect(url_for("login"))
            else:
                return render_template("fix.html", msg="That's the wrong username!")
예제 #2
0
from sharer import Sharer
from utils import users


if __name__ == '__main__':
    for email, password in users():
        Sharer(email, password).create_share()
예제 #3
0
def about():
	users = utils.users()
	#print users
	return(render_template("about.html",users=users))
예제 #4
0
파일: run.py 프로젝트: a4800061/lottery
def users():
    return dict(data=utils.users())