Esempio n. 1
0
def complogin():
    form = loginForm()
    if form.validate_on_submit():
        comp = company.query.filter_by(username=form.username.data).first()
        if comp.check_password_comp(form.password.data):
            login_user(comp)
            return redirect(url_for('welcome_comp'))

    return render_template('login_comp.html')
Esempio n. 2
0
def reclogin():
    form = loginForm()
    if form.validate_on_submit():
        rec = recruiter.query.filter_by(username=form.username.data).first()
        if rec.check_password_rec(form.password.data):
            login_user(rec)
            return redirect(url_for('welcome_rec'))

    return render_template('login_rec.html')
Esempio n. 3
0
def studlogin():
    form_new = loginForm()
    if form_new.validate_on_submit():
        stud = student.query.filter_by(username=form_new.username.data).first()
        if stud.check_password_stud(form_new.password.data):
            login_user(stud)
            flash("logged in succesfully!!!")
            return redirect(url_for('welcome_stud'))

    return render_template('login_stud.html', form_new=form_new)
Esempio n. 4
0
def login():
    form = loginForm()
    if form.validate_on_submit:
        user = users.query.filter_by(email=form.email.data).first()
        if user is not None and user.check_password(form.password.data):
            session['username'] = form.email.data
            session['password'] = form.password.data
            login_user(user)
            next = request.args.get('next')
            if next == None or not next[0] == '/':
                next = url_for('welcome_user')
            return redirect(url_for('welcome_user'))

    return render_template('login.html', form=form)