diff --git a/Controleur/ControleurOpticien.php b/Controleur/ControleurOpticien.php
index efc0241..573a161 100755
--- a/Controleur/ControleurOpticien.php
+++ b/Controleur/ControleurOpticien.php
@@ -166,4 +166,40 @@ class ControleurOpticien extends Controleur {
'contestation' => $contestation));
}
}
+
+
+ public function confirmerotp()
+ {
+ if ($this->requete->existeParametre("otpValue"))
+ {
+ $login = $_SESSION['p_login'];
+ $otpValueSaisi = $this->requete->getParametre("otpValue");
+ $codeTypeFacture = "OPT";
+
+ $otpArray = $this->feuille->get_otp_value($codeTypeFacture);
+
+ $otpValueRequis = $otpArray['otpValue'];
+ $idOtpFacturePrestation = $otpArray['idOtpFacturePrestation'];
+
+ if ( (password_verify($otpValueSaisi, $otpValueRequis)) && (strlen($otpValueSaisi)=='6') )
+ {
+ $this->feuille->maj_otp($idOtpFacturePrestation, '1'); // validé
+ }
+ else
+ {
+ $this->feuille->maj_otp($idOtpFacturePrestation, '9'); // incorrect
+ }
+
+ $this->rediriger("Opticien");
+ }
+ }
+
+ public function envoyerotp()
+ {
+ $codeTypeFacture = "OPT";
+ $otpValue = mt_rand(100000, 999999);
+ $this->feuille->envoyer_otp($codeTypeFacture, $otpValue);
+ $this->rediriger("Opticien");
+ }
+
}
\ No newline at end of file
diff --git a/Vue/Opticien/index.php b/Vue/Opticien/index.php
index 4aec604..4263b32 100755
--- a/Vue/Opticien/index.php
+++ b/Vue/Opticien/index.php
@@ -384,17 +384,60 @@
-
+
+
-
+
+
+
+ = $messageOtp ?>
+
+
+
+
+