Ejemplo n.º 1
0
 def process(req):
     args = req.args
     ps = dict()
     if u'name' in args:
         ps[u'name'] = args.get(u'name')
     if u'password' in args:
         ps[u'password'] = args.get(u'password')
     validate_params(SCHEMA, ps)
     return account_services.signin(ps[u'name'], ps[u'password'])
Ejemplo n.º 2
0
 def process(req):
     args = req.args
     ps = dict()
     if u'name' in args:
         ps[u'name'] = args.get(u'name')
     if u'password' in args:
         ps[u'password'] = args.get(u'password')
     validate_params(SCHEMA, ps)
     return account_services.signin(ps[u'name'], ps[u'password'])
Ejemplo n.º 3
0
def signin_page():
    req = flask.request
    if req.method == u'POST':
        username, pwd = req.form.get(u'username', u''), req.form.get(u'password', u'')
        try:
            resp = account_services.signin(username, md5hex(pwd, lower=False))
            flask.session[u'ticket'] = resp[u'ticket']
            return flask.redirect(u'/publisher/products/list.html')
        except APIError, e:
            return error_page(u'Login error', u'%s (%s)' % (e.message, e.code))
Ejemplo n.º 4
0
def signin_page():
    req = flask.request
    if req.method == u'POST':
        username, pwd = req.form.get(u'username',
                                     u''), req.form.get(u'password', u'')
        try:
            resp = account_services.signin(username, md5hex(pwd, lower=False))
            flask.session[u'ticket'] = resp[u'ticket']
            return flask.redirect(u'/publisher/products/list.html')
        except APIError, e:
            return error_page(u'Login error', u'%s (%s)' % (e.message, e.code))