Commit 8a654980b12098bac15b247f867180adca2516a0
1 parent
a61ed63f
Exists in
mysqli
Classe DB
Showing
1 changed file
with
17 additions
and
14 deletions
Show diff stats
class/solicitante.class.php
@@ -583,16 +583,17 @@ class Solicitante { | @@ -583,16 +583,17 @@ class Solicitante { | ||
583 | 583 | ||
584 | function confirmaCadastro($idsolicitantecripto) | 584 | function confirmaCadastro($idsolicitantecripto) |
585 | { | 585 | { |
586 | + $idsolicitantecripto = DB::esc($idsolicitantecripto); | ||
586 | $sql = "select idsolicitante, nome, email, telefone,tipopessoa, cpfcnpj from lda_solicitante where md5(idsolicitante) = '$idsolicitantecripto' and dataconfirmacao is null"; | 587 | $sql = "select idsolicitante, nome, email, telefone,tipopessoa, cpfcnpj from lda_solicitante where md5(idsolicitante) = '$idsolicitantecripto' and dataconfirmacao is null"; |
587 | - $rs = execQuery($sql); | 588 | + $rs = DB::execQuery($sql); |
588 | 589 | ||
589 | - if (mysql_num_rows($rs)>0) | 590 | + if (mysqli_num_rows($rs)>0) |
590 | { | 591 | { |
591 | - $row = mysql_fetch_array($rs); | 592 | + $row = mysqli_fetch_array($rs); |
592 | $nome = ucwords2($row['nome']); | 593 | $nome = ucwords2($row['nome']); |
593 | $email = $row['email']; | 594 | $email = $row['email']; |
594 | $this->cpfcnpj = $row['cpfcnpj']; | 595 | $this->cpfcnpj = $row['cpfcnpj']; |
595 | - $idsolicitante = $row['idsolicitante']; | 596 | + $idsolicitante = DB::esc($row['idsolicitante']); |
596 | 597 | ||
597 | $sql="UPDATE lda_solicitante SET | 598 | $sql="UPDATE lda_solicitante SET |
598 | dataconfirmacao = CURRENT_DATE(), | 599 | dataconfirmacao = CURRENT_DATE(), |
@@ -648,14 +649,15 @@ class Solicitante { | @@ -648,14 +649,15 @@ class Solicitante { | ||
648 | return false; | 649 | return false; |
649 | } | 650 | } |
650 | 651 | ||
652 | + $cpfcnpj = DB::esc($cpfcnpj); | ||
651 | $sql = "select idsolicitante, nome, email, cpfcnpj, confirmado from lda_solicitante where cpfcnpj = '$cpfcnpj'"; | 653 | $sql = "select idsolicitante, nome, email, cpfcnpj, confirmado from lda_solicitante where cpfcnpj = '$cpfcnpj'"; |
652 | - $rs = execQuery($sql); | 654 | + $rs = DB::execQuery($sql); |
653 | 655 | ||
654 | - if (mysql_num_rows($rs)>0) | 656 | + if (mysqli_num_rows($rs)>0) |
655 | { | 657 | { |
656 | - $row = mysql_fetch_array($rs); | 658 | + $row = mysqli_fetch_array($rs); |
657 | $nome = ucwords2($row['nome']); | 659 | $nome = ucwords2($row['nome']); |
658 | - $chave = substr(md5($row['cpfcnpj']),0,8); | 660 | + $chave = DB::esc(substr(md5($row['cpfcnpj']),0,8)); |
659 | $cpfcnpj = $row['cpfcnpj']; | 661 | $cpfcnpj = $row['cpfcnpj']; |
660 | $email = $row['email']; | 662 | $email = $row['email']; |
661 | $idsolicitante = $row['idsolicitante']; | 663 | $idsolicitante = $row['idsolicitante']; |
@@ -667,7 +669,7 @@ class Solicitante { | @@ -667,7 +669,7 @@ class Solicitante { | ||
667 | chave = '".md5($chave)."' | 669 | chave = '".md5($chave)."' |
668 | WHERE idsolicitante = $idsolicitante"; | 670 | WHERE idsolicitante = $idsolicitante"; |
669 | 671 | ||
670 | - $con = db_open_trans(); | 672 | + $con = DB::conn(); |
671 | $all_query_ok=true; | 673 | $all_query_ok=true; |
672 | 674 | ||
673 | if ($con->query($sql)) | 675 | if ($con->query($sql)) |
@@ -740,17 +742,18 @@ class Solicitante { | @@ -740,17 +742,18 @@ class Solicitante { | ||
740 | return false; | 742 | return false; |
741 | } | 743 | } |
742 | 744 | ||
745 | + $idsolicitante = DB::esc($idsolicitante); | ||
743 | $sql = "select chave from lda_solicitante where idsolicitante = $idsolicitante"; | 746 | $sql = "select chave from lda_solicitante where idsolicitante = $idsolicitante"; |
744 | - $rs = execQuery($sql); | 747 | + $rs = DB::execQuery($sql); |
745 | 748 | ||
746 | - if(mysql_num_rows($rs) == 0) | 749 | + if(mysqli_num_rows($rs) == 0) |
747 | { | 750 | { |
748 | $this->erro = "Solicitante nao encontrado"; | 751 | $this->erro = "Solicitante nao encontrado"; |
749 | return false; | 752 | return false; |
750 | } | 753 | } |
751 | else | 754 | else |
752 | { | 755 | { |
753 | - $row = mysql_fetch_array($rs); | 756 | + $row = mysqli_fetch_array($rs); |
754 | $chave = $row['chave']; | 757 | $chave = $row['chave']; |
755 | 758 | ||
756 | if(md5($senhaatual) != $chave) | 759 | if(md5($senhaatual) != $chave) |
@@ -767,10 +770,10 @@ class Solicitante { | @@ -767,10 +770,10 @@ class Solicitante { | ||
767 | } | 770 | } |
768 | 771 | ||
769 | $sql="UPDATE lda_solicitante SET | 772 | $sql="UPDATE lda_solicitante SET |
770 | - chave = '".md5($novasenha)."' | 773 | + chave = '".DB::esc(md5($novasenha))."' |
771 | WHERE idsolicitante = $idsolicitante"; | 774 | WHERE idsolicitante = $idsolicitante"; |
772 | 775 | ||
773 | - if (!execQuery($sql)) | 776 | + if (!DB::execQuery($sql)) |
774 | { | 777 | { |
775 | $this->erro = "Erro ao alterar senha do solicitante"; | 778 | $this->erro = "Erro ao alterar senha do solicitante"; |
776 | return false; | 779 | return false; |