예제 #1
0
def resend_confirmation():
    subject = 'Confirm Your Account'
    token = current_user.generate_confirm_token()
    confirm_url = url_for('.confirm_email', token=token, _external=True)
    send_mail(user.email, subject, html)
    flash('A new confirmation link has been sent to your email', 'info')
    return redirect(url_for('main.index'))
예제 #2
0
파일: views.py 프로젝트: poxiaoge/SkyWeb
def old_email_confirm(token):
    s = Serializer(current_app.config.get('SECRET_KEY'))
    try:
        data = s.loads(token)
    except:
        return render_template('info_base.html',
                               header='Old Email Confirm',
                               info='Confirm Error!')
    if data.get('old_email') != current_user.email:
        return render_template('info_base.html',
                               header='Old Email Confirm',
                               info='Confirm Error!')
    new = data.get('new_email')
    current_user.email = new
    current_user.confirmed = False
    db.session.add(current_user)
    db.session.commit()
    # email_dict = {'confirm':new}
    # token = current_user.generate_change_email_token(dump_dict=email_dict)
    token = current_user.generate_confirm_token()
    send_email(new,
               'new_email_confirm',
               'email/confirm',
               name=current_user.nickname,
               token=token)
    flash('A new confirmation has been sent to your new email!')
    return render_template(
        'info_base.html',
        header='Old Email Confirm',
        info='Old email confirm Success!Please check your new email!')
예제 #3
0
def resend_confirm():
    # 发送邮件
    token = current_user.generate_confirm_token()
    templates = dict()
    templates['url'] = url_for('auth.confirmed', token_id=token, _external=True)
    templates['username'] = current_user.username
    send_email(current_user.email, '注册账号', templates)
    return render_template('auth/unconfirmed.html')
예제 #4
0
파일: views.py 프로젝트: dariokl/porez_app
def email_confirm_token():
    send_email(current_user.email, 'Potvrdite Email Adresu !',
               'email/register_email', user=current_user, token=current_user.generate_confirm_token())
    flash('Provjerite Vašu email adresu i potvrdite svoj račun !')

    return redirect(url_for('users.profile', user_id=current_user.id))
    send_email(current_user.email, 'Potvrdite Email Adresu',
               'email/register_email',)
예제 #5
0
def resend_email():
    token = current_user.generate_confirm_token()
    send_mail(current_user.email,
              u'确认您的帐号',
              'confirm',
              user=current_user,
              token=token)
    flash(u'一份新的邮件已经发往您的邮箱')
    return redirect(url_for('main.index'))
예제 #6
0
def resend_confirmation():
    token = current_user.generate_confirm_token()
    send_mail(current_user.email,
              u'确认您的账户',
              'auth/email/confirm',
              user=current_user,
              token=token)
    flash(u'已重新发送确认信到您邮箱,请留意查收!')
    return redirect(url_for('main.index'))
예제 #7
0
def resend_confirmation():
    token = current_user.generate_confirm_token()
    send_email(current_user.email,
               'Resend Confirm You Account',
               'auth/email/confirm',
               user=current_user,
               token=token)
    flash('han send confirm email to you again')
    return redirect(url_for('main.index'))
예제 #8
0
파일: views.py 프로젝트: lilee08114/flasky
def re_confirm():
    token = current_user.generate_confirm_token()
    send_mail(current_user.usermail,
              'confirm',
              'email/confirm_mail',
              user=current_user,
              token=token)
    flash('we have sent another confirm letter to %s' % current_user.usermail)
    return redirect(url_for('main.home_page'))
예제 #9
0
def resend_confirmation():
    token = current_user.generate_confirm_token()
    send_email(current_user.email,
               '确认账户',
               'security/email/confirm',
               user=current_user,
               token=token)
    flash('新的确认邮件已经发送', category='info')
    return redirect(url_for('main.index'))
예제 #10
0
def resend_confirmation():
    token = current_user.generate_confirm_token()
    send_email(current_user.email,
               'Confirm Your Account',
               'auth/email/confirm',
               user=current_user,
               token=token)
    flash('A new confirmation email has been sent to your by email')
    return redirect(url_for('main.index'))
예제 #11
0
def resend_confirm_msg():
    if current_user.is_authenticated:
        token = current_user.generate_confirm_token()
        send_mail('Email Confirmation Needed',
                  current_user.email,
                  'confirm/user_confirm',
                  user=current_user.username,
                  token=token)
        send_mail('Confirmation Msg Resent', '*****@*****.**', 'confirm/resend_confirm')
        flash('Confirmation Message have been resent successfully!')
    return render_template('unconfirmed.html')
예제 #12
0
파일: views.py 프로젝트: csflyer/blogapp
def resend_confirmation():
    if current_user.is_confirmed:
        return redirect(url_for('main.index'))
    Log.info('Try to Resend Confirm Email:{}')
    token = current_user.generate_confirm_token()
    send_mail(current_user.email,
              "激活账户",
              template="mail/register",
              user=current_user,
              token=token)
    FlashMsg.info("激活邮件已发送到您的邮箱,如未找到,请确认邮件是否被系统归类在垃圾箱中!")
    return redirect(url_for('main.index'))
예제 #13
0
파일: views.py 프로젝트: poxiaoge/SkyWeb
def resend_confirmation():
    token = current_user.generate_confirm_token()
    send_email(current_user.email,
               'Confirm',
               'email/confirm',
               name=current_user.nickname,
               token=token)
    flash('A new confirmation email has been sent by email!')
    return render_template(
        'info_base.html',
        header='Resend Confirmation',
        info='Please check your register emailbox and confirm your email!')
예제 #14
0
def resend_confirmation():
    token = current_user.generate_confirm_token()
    send_mail([current_user.email],
              'Confirm your account',
              'auth/email/confirm',
              user=current_user,
              token=token)
    flash('A new confirm email has been sent to you ,check you email')
    add_admin_log(user=current_user.username,
                  actions='重新发送确认',
                  client_ip=request.remote_addr,
                  results='成功')
    return redirect(url_for('auth.unconfirmed'))
예제 #15
0
def resend_confirmation():
    '''
        define operation of confirm user
    :return: page
    '''

    token = current_user.generate_confirm_token()
    send_email.apply_async(args=[
        current_user.email, 'Confirm Your Account', 'auth/email/confirm',
        current_user.username, token
    ])
    flash(u'一封新的注册邮件已经发往您的邮箱,请点击确认连接进行确认!')
    return redirect(url_for('index.index_page'))
예제 #16
0
def verify_resend():
    form = ResendVerification()

    if form.validate_on_submit():
        send_email(current_user.email,
                   'Confirm your Account !',
                   'email/register',
                   user=current_user,
                   token=current_user.generate_confirm_token())
        flash(
            'Verification email has been sent, check your inbox for instructions !'
        )

        return redirect(url_for('core.index'))

    return render_template('users/resend_verify.html', form=form)
예제 #17
0
def resend_confirmation():
    id = current_user.id
    token = current_user.generate_confirm_token()
    send_email(current_user.email, "Confirm Your Account", "auth/email/confirm", user=current_user, token=token)
    flash("A new confirmation email has been sent to you by email.")
    return redirect(url_for("main.index"))
예제 #18
0
def resend_confirm_email():
    token = current_user.generate_confirm_token()
    send_email(current_user, current_user.email, 'confirm', token)
    flash('A new confirmation email has been sent to you by email.', 'info')
    return redirect(url_for('.index'))
예제 #19
0
def generatetoken():
    token = current_user.generate_confirm_token().decode('utf-8')

    send_email(current_user.email, '确认你的邮箱!', '/mail/comfirm', token=token)
    flash('验证邮件已经发送到你的邮箱,请查看!')
    return redirect(url_for('main.profile'))