Esempio n. 1
0
try {
    if ($dataPost) {
        if ($dataPost['senha'] == NULL) {
            $response['error'][] = 'Preencher senha corretamente (mínimo 5 caracteres)';
        } else {
            if ($dataPost['nivel'] == 'admin') {
                $data['senha'] = FUNCOES::cryptografar($dataPost['senha']);
                usuarioBO::salvarUsuario($data, 'usuarios', $dataPost['nid']);
                $response['success'][] = 'Senha alterada com sucesso !!!';
            } elseif ($dataPost['nivel'] == 'revenda') {
                $data['senha'] = FUNCOES::cryptografar($dataPost['senha']);
                revendedorBO::salvar($data, 'revenda', $dataPost['nid']);
                $response['success'][] = 'Senha alterada com sucesso !!!';
            } elseif ($dataPost['nivel'] == 'usuario') {
                $data['passwlogin'] = $dataPost['senha'];
                usuarioBO::salvarUsuario($data, 'users', $dataPost['nid']);
                $response['success'][] = 'Senha alterada com sucesso !!!';
            }
        }
    } elseif ($dataGet['nivel'] == "admin") {
        $dado = usuarioBO::getUsuarios($dataGet['nid']);
        $token = FUNCOES::cryptografar($dataGet['nid'] . $dado->senha);
        if ($token !== $dataGet['token']) {
            throw new Exception('Parâmetros incorretos !!!');
        }
    } elseif ($dataGet['nivel'] == "revenda") {
        $dado = revendedorBO::getRevendedor($dataGet['nid']);
        $token = FUNCOES::cryptografar($dataGet['nid'] . $dado['senha']);
        if ($token !== $dataGet['token']) {
            throw new Exception('Parâmetros incorretos !!!');
        }
Esempio n. 2
0
                $data['data_vencimento'] = FUNCOES::formatarDatatoHTML($data['data_vencimento']);
            }
        } catch (Exception $err) {
            $response['error'][] = $err->getMessage();
        }
    }
    /**
     * BOT TELEGRAM   ---- 255747822:AAFM7ZzxOeHbSRTn2_EapG4wCdIrQ-8dmQM
     */
    if ($data_telegram['bot_token'] && empty($response['error'])) {
        if (empty($data_telegram['users_bots_id'])) {
            $data_telegram['users_id'] = $datauser['id'];
            $data_telegram['canal'] = "telegram";
            usuarioBO::salvarUsuario($data_telegram, 'users_bots');
        } else {
            usuarioBO::salvarUsuario($data_telegram, 'users_bots', $data_telegram['users_bots_id']);
        }
    }
} catch (Exception $ex) {
    $response['error'][] = $ex->getMessage();
}
if (FUNCOES::isAjax()) {
    print json_encode($response);
    exit;
}
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <title><?php 
echo TITLE;