Exemplo n.º 1
0
def useridValidCheck():
    error = None
    if request.method == 'POST':
        candidate_user_id = request.form['id']
        if candidate_user_id == "":
            error = 'No Data'
        else:
            userInfo = userinfo.UserInfo()
    return error
Exemplo n.º 2
0
def login():
    error = None
    if request.method == 'POST':
        user_id = request.form['person_id']
        pwss = request.form['password']
        print(user_id, pwss)
        if "" in [user_id, pwss]:
            error = 'Empty Filed'
        else:
            user = userinfo.UserInfo(user_id)
            error = user.Login(pwss)
        return render_redirect('login.html', 'main_page', error)
    else:
        return render_template('login.html')
Exemplo n.º 3
0
def register():
    error = None
    if request.method == 'POST':
        user_id = request.form['person_id']  # login id
        pwss = request.form['password']  # password
        user_name = request.form['name']  # your personal name
        email = request.form['email']  # your eamil
        identifyNum = request.form['idNumber']  # local number

        if "" in [user_id, pwss, user_name, email, identifyNum]:
            error = 'Empty Filed'
        else:
            user = userinfo.UserInfo(email)
            error = user.Register(user_id, pwss, user_name, email, identifyNum)
        return render_redirect('main.html', 'main_page', error)
    else:
        return render_template('registration.html')
Exemplo n.º 4
0
def logout():
    error = userinfo.UserInfo(session.get).Logout()
    if error is False:
        return redirect(url_for('main_page'))
    else:
        return render_redirect('main.html', 'main_page', error)
Exemplo n.º 5
0
def check_mypost():
    mypost = userinfo.UserInfo(session['person_id']).GetMyPost()
    print(mypost)
    return render_template("index.html", mypost=mypost, list=defaultList)
Exemplo n.º 6
0
def check_myinfo():
    myinfo = userinfo.UserInfo(session['person_id']).GetMyInfo()
    print(myinfo)
    return render_template("myinfo.html", myinfo=myinfo, list=defaultList)