Beispiel #1
0
def apiTemp_get():
    if request.method == "POST":
        returnJson = userdb.get({
            'uuid':
            session["user"]["uuid"] if session["user"].has_key("uuid") else ""
        })
        return jsonify(returnJson)
Beispiel #2
0
def apiTemp_login():
    if request.method == "POST":
        formJson = request.get_json()
        print formJson
        returnJson = userdb.login({ 'loginID': escape(formJson["loginID"]),
                                                   'password': escape(formJson['password']) })
        if returnJson.has_key("uuid"):
            session["user"] = userdb.get({"uuid": returnJson["uuid"]}).get("user", {})
        return jsonify(returnJson)
Beispiel #3
0
def apiTemp_login():
    if request.method == "POST":
        formJson = request.get_json()
        print formJson
        returnJson = userdb.login({
            'loginID': escape(formJson["loginID"]),
            'password': escape(formJson['password'])
        })
        if returnJson.has_key("uuid"):
            session["user"] = userdb.get({
                "uuid": returnJson["uuid"]
            }).get("user", {})
        return jsonify(returnJson)
Beispiel #4
0
def apiTemp_get():
    if request.method == "POST":
        returnJson = userdb.get({  'uuid': session["user"]["uuid"] if session["user"].has_key("uuid") else "" })
        return jsonify(returnJson)