Beispiel #1
0
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)
Beispiel #2
0
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))
Beispiel #3
0
def _logout():
    c.session['logged_in'] = False
    return c.redirect(c.url_for('hello_world'))
Beispiel #4
0
def hello_world():
    return c.redirect(c.url_for('_window'))
Beispiel #5
0
def _info_storepwd_():
    return c.redirect(c.url_for('_info_storepwd', store_id=c.session['store']))