コード例 #1
0
def reset_password_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.index'))
    form = ResetPasswordRequestForm()
    if form.validate_on_submit():
        user = Utilisateur.query.filter_by(email=form.email.data).first()
        if user:
            send_password_reset_email(user)
        flash(_l('Consultez votre e-mail et suivez les instructions'))
        return redirect(url_for('auth.login'))
    return render_template('auth/reset_password_request.html', form=form)
コード例 #2
0
def reset_password_request():

    if current_user.is_authenticated:
        flash('Faut se deconnecter ')
        return redirect(url_for('index'))
    form = ResetPasswordRequestForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        if user:
            send_password_reset_email(user)
            flash('Consultez votre mail  et suivez les instructions ')
            return redirect(url_for('login'))
    return render_template('reset_password_request.html', form=form)
コード例 #3
0
def reset_password_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.index'))
    form = ResetPasswordRequestForm()
    if form.validate_on_submit():
        user = User.query.filter_by(email=form.email.data).first()
        if user:
            send_password_reset_email(user)
        flash('Check your email for the instructions to reset your password')
        return redirect(url_for('login'))
    return render_template('auth/reset_password_request.html',
                           title='Reset Password',
                           form=form)
コード例 #4
0
def reset_password_request():
    if current_user.is_authenticated:
        return redirect(url_for('main.index'))

    formulaire = ResetPasswordRequestForm()

    if formulaire.validate_on_submit():
        utilisateur = User.query.filter_by(email=formulaire.email.data).first()
        if (utilisateur is None):
            flash('Email innconu!!!!')
        else:
            send_password_reset_email(utilisateur)
            flash('Email Envoyer!!!!')
            return redirect(url_for('auth.login'))
    return render_template("auth/newMDP.html",
                           title='reinitialisation',
                           form=formulaire)