Esempio n. 1
0
    def POST(self):    
        login  = LoginAccountForm(Request().POST)
        create = CreateAccountForm() 
        if login.validate() != True: 
            return render('site_admin.mako', site_type='login', login=login, create=create)

        post = web.input()
        import hashlib
        psswrd = hashlib.sha1(post.password).hexdigest()
        query = db.users.filter_by(name=post.username, password=psswrd).first()
    
        if query:
            user = query.id
        else:
            user = False

        return sa.login({ 
            'check' : query,
            'redirect_to_if_pass' : '../welcome/',
            'redirect_to_if_fail' : '../',
            'user' : user
        })
Esempio n. 2
0
 def GET(self):
     return render('index.mako')
Esempio n. 3
0
 def POST(self): 
     login  = LoginAccountForm()
     create = CreateAccountForm(Request().POST) 
     if create.validate() != True:
         return render('index.mako', login=login, create=create)
     return web.input()
Esempio n. 4
0
 def GET(self):
     login = LoginAccountForm()
     create = CreateAccountForm()
     mast = masthead.index().GET('Mathew')
     logged_in = web.ctx.session.get('loggedIn')
     return render('header.mako', login=login, create=create, mast=mast, logged_in=logged_in)