def change_email(): form = ChangeEmailForm() if form.validate_on_submit(): token = current_user.generate_change_email_token(new_email = form.New_email.data) send_email(form.New_email.data,'Confirm your new email','auth/change/change_email',user=current_user,token=token) flash('A confirmation email has been sent to your new email. Please confirm that mail to change your email address.') return redirect(url_for('main.index')) return render_template('auth/change/change_email_index.html', form = form)
def change_email_request(): form = ChangeEmail() if form.validate_on_submit(): token = current_user.generate_change_email_token() send_email(form.new_email.data, 'change email', 'email/change_email', token=token, user=current_user) flash('an email send to your new email of change email.') return redirect(url_for('main.index')) return render_template('auth/change_email.html', form=form)
def change_email(): form = ChangeEmailForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): token = current_user.generate_change_email_token(form.email.data) send_mail(form.email.data, '修改邮箱确认', 'auth/email/change_email_confirm', user=current_user, token=token) flash('确认邮件已发送到该新邮箱,请登录新邮箱进行验证。') else: flash('密码错误,请重新输入!') return render_template('auth/change_email.html', form=form)
def change_email_request(): form = user_forms.change_email_form() if form.validate_on_submit():#已在form中对旧密码进行验证 token = current_user.generate_change_email_token(new_email=form.new_email.data) send_email( form.new_email.data,'CHANGE YOUR EMAIL', 'auth/email/change_email',user=current_user,token=token) flash('A email has been sent to your new email addr:'+form.new_email.data) return redirect( url_for( 'main.base')) else: return render_template('auth/change_email.html',form=form)
def change_email_request(): form = ChangeEmailForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): token = current_user.generate_change_email_token(new_email=form.new_email.data) send_email(form.email.data,'change your email address','auth/email/change_email',token=token,user=current_user) flash('we have sent a mail to you.') return redirect(url_for('main.index')) else: flash('Invalid email or password.') return render_template('auth/change_email.html',form=form)
def change_email_request(): form = ChangeEmailForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): new_email = form.email.data token = current_user.generate_change_email_token(new_email=new_email) send_mail(current_user.email, "Change Email", "auth/email/change_email", user=current_user, token=token) flash("An email with instructions to confirm email address has been sent to you.") else: flash("Invalid email or password.") return render_template("auth/change_email.html", form=form)
def change_email_request(): form = ChangeEmailForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): token = current_user.generate_change_email_token(form.new_email.data) send_email(form.new_email.data, 'Change Your Email', 'auth/email/change_email', user = current_user, token = token) flash('A confirmation email has been sent to your new email.') return redirect(url_for('main.index')) else: flash("Invalid email or password!") return render_template('auth/change_email.html', form = form)
def change_email_request(): ''' 用户输入新邮件地址,并发送一封确认邮件''' form = EmailResetForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): token = current_user.generate_change_email_token(form.email.data) send_email(form.email.data, '验证您的新邮箱','auth/email/change_email', user = current_user, token = token) flash('一封确认邮件已经发送到了您的新邮箱') else: flash('密码不正确') return redirect(url_for('auth.change_email_request')) return render_template('auth/change_email.html', form = form)
def change_email_request(): form = ChangeEmailForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): new_email = form.new_email.data token = current_user.generate_change_email_token(new_email) send_email(new_email,'确认邮箱', 'auth/email/change_email',token=token) flash('确认邮件已发到您的新邮箱') return redirect(url_for('main.index')) else: flash('邮箱或密码错误') return render_template('auth/change_email.html',form=form)
def change_email_request(): form = ChangeEmailForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): new_email = form.email.data token = current_user.generate_change_email_token(new_email) send_email(new_email, '修改你的邮箱地址', 'auth/email/change_email', user=current_user, token=token) flash('一封确认你新邮箱地址的邮件已经发送到你的邮箱') return redirect(url_for('main.index')) else: flash('无效的邮箱或密码') return render_template('auth/change_email.html', form=form)
def change_email(): form = ChangeEmailForm() if form.validate_on_submit(): token = current_user.generate_change_email_token( new_email=form.New_email.data) send_email(form.New_email.data, 'Confirm your new email', 'auth/change/change_email', user=current_user, token=token) flash( 'A confirmation email has been sent to your new email. Please confirm that mail to change your email address.' ) return redirect(url_for('main.index')) return render_template('auth/change/change_email_index.html', form=form)
def changeEmail(): form = ChangeEmailForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): new_email = form.email.data token = current_user.generate_change_email_token(new_email) send_email(new_email, 'Confirm your email address', 'auth/email/change_email', user=current_user, token=token) flash('An email with instructions to confirm your new email ' 'address has been sent to you.') return redirect(url_for('main.index')) else: flash('Invalid email or password.') return render_template('auth/change_email.html', form=form)
def change_email_request(): form = user_forms.change_email_form() if form.validate_on_submit(): #已在form中对旧密码进行验证 token = current_user.generate_change_email_token( new_email=form.new_email.data) send_email(form.new_email.data, 'CHANGE YOUR EMAIL', 'auth/email/change_email', user=current_user, token=token) flash('A email has been sent to your new email addr:' + form.new_email.data) return redirect(url_for('main.base')) else: return render_template('auth/change_email.html', form=form)
def change_email_request(): if current_user.is_anonymous: return redirect(url_for('main.index')) form = ChangeEmailRequestForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): new_email = form.email.data token = current_user.generate_change_email_token(new_email) send_email(new_email,'Change-Email','auth/email/change_email', user=current_user, token=token) flash(u'请登录你的邮箱确认修改邮件!') return redirect(url_for('main.index')) else: flash(u'输入密码错误,请重新输入!') return render_template('auth/change_email.html', form=form)
def change_email_request(): ''' 用户输入新邮件地址,并发送一封确认邮件''' form = EmailResetForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): token = current_user.generate_change_email_token(form.email.data) send_email(form.email.data, '验证您的新邮箱', 'auth/email/change_email', user=current_user, token=token) flash('一封确认邮件已经发送到了您的新邮箱') else: flash('密码不正确') return redirect(url_for('auth.change_email_request')) return render_template('auth/change_email.html', form=form)
def change_email_request(): if current_user.is_anonymous: return redirect(url_for('main.index')) form = ChangeEmailRequestForm() if form.validate_on_submit(): if current_user.verify_password(form.password.data): new_email = form.email.data token = current_user.generate_change_email_token(new_email) send_email(new_email, 'Change-Email', 'auth/email/change_email', user=current_user, token=token) flash(u'请登录你的邮箱确认修改邮件!') return redirect(url_for('main.index')) else: flash(u'输入密码错误,请重新输入!') return render_template('auth/change_email.html', form=form)