def _login(): error = '' if c.is_GET(): pass elif c.is_POST(): with orm.session_scope() as ss: # type:c.typeof_Session id = c.data_POST('user') pw = c.data_POST('password') account = ss.query(orm.account) \ .filter_by(아이디=id) \ .first() if account is None: error = '아이디 또는 패스워드를 잘못 입력하셨습니다.' elif c.pw_hash(pw) != account.패스워드: error = '아이디 / 패스워드를 잘못 입력하셨습니다.' else: c.account_session(orm, account, c.session) if account.s == 0: return c.redirect('http://asp.van.or.kr:8082/window') return c.redirect(c.url_for('hello_world')) return c.display(error=error)
def _system_menu_(): sid = c.session['store'] with orm.session_scope() as ss: # type:c.typeof_Session if c.is_GET(): gl = menugroup_query(ss, sid).first() return c.redirect(c.url_for('_system_menu', group_id=gl.id))
def _logout(): c.session['logged_in'] = False return c.redirect(c.url_for('hello_world'))
def hello_world(): return c.redirect(c.url_for('_window'))
def _info_storepwd_(): return c.redirect(c.url_for('_info_storepwd', store_id=c.session['store']))