PageRenderTime 25ms CodeModel.GetById 38ms RepoModel.GetById 1ms app.codeStats 0ms

/www/phpClientHmgSimec/samples/auth/loginUserIntoSystemByCPFOrCNPJAndPassword.php

https://gitlab.com/culturagovbr/simec
PHP | 47 lines | 43 code | 4 blank | 0 comment | 4 complexity | f4a77172f9b0f362731f73b579abdde0 MD5 | raw file
  1. <?php
  2. if (isset($_POST['submit'])) {
  3. require_once("../connector.php");
  4. require("../debug.php");
  5. header("Content-Type: text/html; charset=utf-8");
  6. ob_start();
  7. try {
  8. msgOutput("[SIMEC] LOGAR USU&Aacute;RIO NO SISTEMA POR CPF/CNPJ E SENHA");
  9. $SSDWs = new SSDWsAuth($tmpDir, $clientCert, $privateKey, $privateKeyPassword, $trustedCaChain);
  10. msgOutput("Conectando...");
  11. if ($GLOBALS['USE_PRODUCTION_SERVICES']) {
  12. $SSDWs->useProductionSSDServices();
  13. msgOutput("Servidor de PRODU&Ccedil;&Atilde;O conectado. WSDL baixada.");
  14. } else {
  15. $SSDWs->useHomologationSSDServices();
  16. msgOutput("Servidor de HOMOLOGA&Ccedil;&Atilde;O conectado. WSDL baixada.");
  17. }
  18. $cpfOrCnpj = base64_encode($_POST['cpfOrCnpj']);
  19. $password = base64_encode($_POST['password']);
  20. $resposta = $SSDWs->loginUserIntoSystemByCPFOrCNPJAndPassword($cpfOrCnpj, $password);
  21. echo "<pre>";
  22. print_r($resposta);
  23. echo "</pre>";
  24. } catch (Exception $e) {
  25. $erro = $e->getMessage();
  26. echo $erro;
  27. exit();
  28. }
  29. ?>
  30. <a href="javascript:history.back()">Voltar</a> |
  31. <?
  32. } else {
  33. ?>
  34. <h3>[SIMEC] LOGAR USU&Aacute;RIO NO SISTEMA POR CPF/CNPJ E SENHA</h3>
  35. <form method="POST">
  36. <label>CPF/CNPJ:</label> <input type="text" name="cpfOrCnpj" /><br />
  37. <label>Senha:</label> <input type="password" name="password" /><br />
  38. <input type="submit" value="Enviar" name="submit">
  39. </form>
  40. <?php
  41. }
  42. ?>
  43. <a href="../index.php">Menu Principal</a>