Exemple #1
0
def user_list(cod_cliente):
    results = db_execute_scalar("EXEC SPT_WEBV3_LIST_USUARIOS %s;",
                                cod_cliente)
    if results:
        return jsonify(results)
    else:
        return '', 204
Exemple #2
0
def user_del(email):
    results = db_execute_scalar("EXEC SPT_WEBV3_DEL_USUARIO %s;", email)
    data = {"status": True, "errorCod": "", "data": results}
    if results:
        return jsonify(results)
    else:
        return '', 204
Exemple #3
0
def user_validate():
    results = db_execute_scalar(
        "EXEC SPT_WEBV3_VALIDA_USUARIO %s, %s;",
        (request.json['email'], encrypt_pass(request.json['password'])))
    if results:
        return jsonify(results)
    else:
        return '', 401
Exemple #4
0
def user_password(id_user):
    if not request.json:
        abort(406)
    results = db_execute_scalar(
        "EXEC SPT_WEBV3_SET_SENHA %s, %s;",
        (encrypt_pass(request.json['password']), id_user))
    if results:
        return jsonify(results)
    else:
        return '', 204
Exemple #5
0
def user_set(cod_cliente):
    if not request.json:
        abort(406)
    results = db_execute_scalar(
        "EXEC SPT_WEBV3_SET_USUARIO %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s;",
        (cod_cliente, request.json['user']['EMAIL'],
         request.json['user']['NOME'], request.json['user']['SETOR'],
         request.json['user']['_inclPedido'],
         request.json['user']['_visuCobranca'],
         request.json['user']['_inclNovoEndereco'],
         request.json['user']['_recEmailPedido'],
         request.json['user']['_recebEmailDanf'],
         request.json['user']['_recEmailembarque'],
         request.json['user']['_recebEmailBoleto'],
         request.json['user']['_recEmailatraso'],
         request.json['user']['_recEmailtresdias'],
         request.json['user']['_recEmailnegativar'], '', ''))
    if results:
        return jsonify(results)
    else:
        return '', 204
Exemple #6
0
def user_create(cod_cliente):
    if not request.json:
        abort(406)
    new_key = id_generator()
    crpt_key = encrypt_pass(new_key)
    results = db_execute_scalar(
        "EXEC SPT_WEBV3_CREATE_USUARIO %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s;",
        (cod_cliente, request.json['user']['EMAIL'],
         request.json['user']['NOME'], crpt_key, request.json['user']['SETOR'],
         request.json['user']['_inclPedido'],
         request.json['user']['_visuCobranca'],
         request.json['user']['_inclNovoEndereco'],
         request.json['user']['_recEmailPedido'],
         request.json['user']['_recebEmailDanf'],
         request.json['user']['_recEmailembarque'],
         request.json['user']['_recebEmailBoleto'],
         request.json['user']['_recEmailatraso'],
         request.json['user']['_recEmailtresdias'],
         request.json['user']['_recEmailnegativar'], '', ''))
    if results:
        return jsonify(results)
    else:
        return '', 204
Exemple #7
0
def user_companies(id_user):
    results = db_execute_scalar("EXEC SPT_WEBV3_LIST_EMPRESAS %s;", id_user)
    if results:
        return jsonify(results)
    else:
        return '', 204
Exemple #8
0
def user_get(email):
    results = db_execute_scalar("EXEC SPT_WEBV3_GET_USUARIO %s;", email)
    if results:
        return jsonify(results)
    else:
        return '', 204