Esempio n. 1
1
def createaccount():
    form = AccountForm.RegisterForm()
    formLogin = AccountForm.LoginForm()
    if request.method =='GET':
        return render_template('createaccount.html',form=form,formLogin=formLogin)
    if request.method =='POST':
        if request.form.get('login', None)  == 'Login' :
            return AccountController.authenticatePopUpLogin(formLogin,'index')
        return AccountController.createuser(form=form, formLogin=formLogin)
Esempio n. 2
0
def register():
    template = None
    if request.method == 'GET':
        template = render_template('register.html', session=session)
    elif request.method == 'POST':
        # TODO passwordCheck

        if (request.form.get('emailAddress1') == request.form.get(
                'emailAddress2')):
            print("emails correspond")
        else:
            print("emails don't correspond")

        if (request.form.get('password1') == request.form.get('password2')):
            print("passwords correspond")
        else:
            print("emails don't correspond")

        AccountController.createAccount(request.form.get('firstName'),
                                        request.form.get('lastName'),
                                        request.form.get('emailAddress1'),
                                        request.form.get('username'),
                                        request.form.get('password1'))
        return redirect(url_for('do_login'))

    return template
Esempio n. 3
0
def createaccount():
    form = AccountForm.RegisterForm()
    formLogin = AccountForm.LoginForm()
    if request.method == "GET":
        return render_template("createaccount.html", form=form, formLogin=formLogin)
    if request.method == "POST":
        if request.form.get("login", None) == "Login":
            return AccountController.authenticatePopUpLogin(formLogin, "index")
        return AccountController.createuser(form=form, formLogin=formLogin)
Esempio n. 4
0
def index():
    formLogin = AccountForm.LoginForm()
    if request.method == "GET":
        return render_template("index.html", formLogin=formLogin)
    if request.method == "POST":
        if request.form.get("login", None) == "Login":
            return AccountController.authenticatePopUpLogin(formLogin, "index")
Esempio n. 5
0
def index():
    formLogin = AccountForm.LoginForm()
    if request.method == 'GET' :
        return render_template('index.html',formLogin=formLogin)
    if request.method == 'POST' :
        if request.form.get('login', None)  == 'Login' :
            return AccountController.authenticatePopUpLogin(formLogin,'index')
Esempio n. 6
0
def checkout():
    """ To address user pop up login , we have to pass formLogin to each page """
    formLogin = AccountForm.LoginForm()
    if request.method == 'GET' :
        return render_template('checkout.html',formLogin=formLogin)
    if request.method == 'POST' :
        if request.form.get('login', None)  == 'Login' :
            return AccountController.authenticatePopUpLogin(formLogin,'checkout')
Esempio n. 7
0
def checkout():
    """ To address user pop up login , we have to pass formLogin to each page """
    formLogin = AccountForm.LoginForm()
    if request.method == "GET":
        return render_template("checkout.html", formLogin=formLogin)
    if request.method == "POST":
        if request.form.get("login", None) == "Login":
            return AccountController.authenticatePopUpLogin(formLogin, "checkout")
Esempio n. 8
0
def login():
    form = AccountForm.LoginForm()
    if request.method == 'GET' :
        if g.user.is_authenticated() == False:
            return render_template('login.html', form=form)
        if g.user.is_authenticated():
            return redirect(url_for('index'))
            
    return AccountController.authenticate(form = form)
Esempio n. 9
0
def login():
    form = AccountForm.LoginForm()
    if request.method == "GET":
        # Check if user is already logged in, return login page if not, otherwise index
        if g.user.is_authenticated() == False:
            return render_template("login.html", form=form, formLogin=form)
        if g.user.is_authenticated():
            return redirect(url_for("index"))

    return AccountController.authenticate(form=form)
Esempio n. 10
0
def editaccount():
    acct = AccountController(request)
    return acct.editaccount()
Esempio n. 11
0
def login():
    log = AccountController(request)
    return log.login()
Esempio n. 12
0
def user_collections(title=None):
    userCol = AccountController(request)
    return userCol.collections()
Esempio n. 13
0
def createaccount():
    form = AccountForm.RegisterForm()
    if request.method =='GET':
        return render_template('createaccount.html',form=form)
    if request.method =='POST':
        return AccountController.createuser(form=form)
Esempio n. 14
0
def createaccount():
    acct = AccountController(request)
    return acct.createaccount()
Esempio n. 15
0
def accountsuccess():
    acct_suc = AccountController(request)
    acct_suc.accountsuccess()
Esempio n. 16
0
def edit_collection():
    userCol = AccountController(request)
    return userCol.editCollection()
Esempio n. 17
0
def add_collection(username=None):
    add_coll = AccountController(request)
    return add_coll.add_collection()