def signin(): result = (None, None) if request.method == 'POST': uid = request.form['userid'] pwss = request.form['password'] if "" in [uid, pwss]: result = ('error', 'Empty Filed') else: user = User(db.connect_db(), uid) result = user.signin(pwss) session['signin'] = user.session_signin session['uid'] = user.uid session['username'] = user.name return render_redirect('signin.html', 'front', result) else: return session_out('signin.html')
def signup(): result = (None, None) if request.method == 'POST': uid = request.form['userid'] name = request.form['username'] email = request.form['email'] pwss = request.form['password'] chkbox = request.form.getlist('chkbox') if(len(chkbox)): user = User(db.connect_db(), uid) result = user.signup(uid, name, email, pwss) else: result = ('error', '약관에 동의해야합니다.') return render_redirect('signup.html', 'signin', result) else: return session_out('signup.html')