Example #1
0
def change_openid():
    if request.method == "POST":
        if "cancel" in request.form:
            flash(u"Cancelled. The OpenID was not changed.")
            return redirect(oid.get_next_url())
    openid = request.values.get("openid")
    if not openid:
        openid = COMMON_PROVIDERS.get(request.args.get("provider"))
    if openid:
        return oid.try_login(openid)
    error = oid.fetch_error()
    if error:
        flash(u"Error: " + error)
    return render_template("general/change_openid.html", next=oid.get_next_url())
Example #2
0
def login():
    if g.user is not None:
        return redirect(url_for("general.index"))
    if "cancel" in request.form:
        flash(u"Cancelled. The OpenID was not changed.")
        return redirect(oid.get_next_url())
    openid = request.values.get("openid")
    if not openid:
        openid = COMMON_PROVIDERS.get(request.args.get("provider"))
    if openid:
        return oid.try_login(openid, ask_for=["fullname", "nickname"])
    error = oid.fetch_error()
    if error:
        flash(u"Error: " + error)
    return render_template("general/login.html", next=oid.get_next_url())
Example #3
0
def change_openid():
    if request.method == 'POST':
        if 'cancel' in request.form:
            flash(u'Cancelled. The OpenID was not changed.')
            return redirect(oid.get_next_url())
    openid = request.values.get('openid')
    if not openid:
        openid = COMMON_PROVIDERS.get(request.args.get('provider'))
    if openid:
        return oid.try_login(openid)
    error = oid.fetch_error()
    if error:
        flash(u'Error: ' + error)
    return render_template('general/change_openid.html',
                           next=oid.get_next_url())
Example #4
0
def login():
    if g.user is not None:
        return redirect(url_for('general.index'))
    if 'cancel' in request.form:
        flash(u'Cancelled. The OpenID was not changed.')
        return redirect(oid.get_next_url())
    openid = request.values.get('openid')
    if not openid:
        openid = COMMON_PROVIDERS.get(request.args.get('provider'))
    if openid:
        return oid.try_login(openid, ask_for=['fullname', 'nickname'])
    error = oid.fetch_error()
    if error:
        flash(u'Error: ' + error)
    return render_template('general/login.html', next=oid.get_next_url())
Example #5
0
def change_openid():
    if request.method == 'POST':
        if 'cancel' in request.form:
            flash(u'Cancelled. The OpenID was not changed.')
            return redirect(oid.get_next_url())
    openid = request.values.get('openid')
    if not openid:
        openid = COMMON_PROVIDERS.get(request.args.get('provider'))
    if openid:
        return oid.try_login(openid)
    error = oid.fetch_error()
    if error:
        flash(u'Error: ' + error)
    return render_template('general/change_openid.html',
                           next=oid.get_next_url())
Example #6
0
def login():
    if g.user is not None:
        return redirect(url_for('general.index'))
    if 'cancel' in request.form:
        flash(u'Cancelled. The OpenID was not changed.')
        return redirect(oid.get_next_url())
    openid = request.values.get('openid')
    if not openid:
        openid = COMMON_PROVIDERS.get(request.args.get('provider'))
    if openid:
        return oid.try_login(openid, ask_for=['fullname', 'nickname'])
    error = oid.fetch_error()
    if error:
        flash(u'Error: ' + error)
    return render_template('general/login.html', next=oid.get_next_url())