Example #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)
Example #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
Example #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)
Example #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")
Example #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')
Example #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')
Example #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")
Example #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)
Example #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)
Example #10
0
def editaccount():
    acct = AccountController(request)
    return acct.editaccount()
Example #11
0
def login():
    log = AccountController(request)
    return log.login()
Example #12
0
def user_collections(title=None):
    userCol = AccountController(request)
    return userCol.collections()
Example #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)
Example #14
0
def createaccount():
    acct = AccountController(request)
    return acct.createaccount()
Example #15
0
def accountsuccess():
    acct_suc = AccountController(request)
    acct_suc.accountsuccess()
Example #16
0
def edit_collection():
    userCol = AccountController(request)
    return userCol.editCollection()
Example #17
0
def add_collection(username=None):
    add_coll = AccountController(request)
    return add_coll.add_collection()