Beispiel #1
0
def login_mahasiswa():
    if current_user.is_authenticated:
        return redirect(url_for('vmahasiswa.home'))
    form = loginmahasiswa_F()
    if form.validate_on_submit():
        ceknpm = Tmahasiswa.query.filter_by(npm=form.npm.data).first()
        if ceknpm and bcrypt.check_password_hash(ceknpm.password, form.password.data):
            login_user(ceknpm)
            flash('SELAMAT DATANG KEMBALI', 'warning')
            return redirect(url_for('vmahasiswa.akunmahasiswa'))
        else:
            flash('LOGIN GAGAL, PERIKSA NPM DAN PASSWORD KEMBALI!!', 'warning')
    return render_template("login_mahasiswa.html", form=form)
Beispiel #2
0
def login_mahasiswa():
    if current_user.is_authenticated:
        return redirect(url_for('rmahasiswa.home'))
    form=loginmahasiswa_F()
    if form.validate_on_submit():
        ceknpm= Tmahasiswa.query.filter_by(npm=form.npm.data).first()
        if ceknpm and bcrypt.check_password_hash(ceknpm.password, form.password.data):
            login_user(ceknpm)
            flash('Selamat Datang Kembali', 'Warning')
            return redirect(url_for('rmahasiswa.akunmahasiswa'))
        else:
            flash('Login Gagal, Periksa Password dan NPM kembali!', 'danger')
    return render_template("login_mahasiswa.html", form=form)
Beispiel #3
0
def user():
    if current_user.is_authenticated:
        return redirect(url_for('Suser.home'))
    form=login()
    if request.method == 'POST':
        ceknik=Tpenduduk.query.filter_by(nik=form.username.data).first()
        if ceknik and bcrypt.check_password_hash(ceknik.password, form.password.data):
            login_user(ceknik)
            flash('selamat Datang Kembali', 'warning')
            return redirect(url_for('Suser.home'))
        else:
            flash('login gagal, periksa username dan Password!', 'danger')
    return render_template("login_user.html", form=form)