diff --git a/html/compute.php b/html/compute.php index 0a2fbc2d4..a004865d8 100644 --- a/html/compute.php +++ b/html/compute.php @@ -42,6 +42,23 @@ MaintenanceMode("block.html"); $http=new HttpInput(); +//------------------------------------------------ +// refresh code from otp-link.php +//------------------------------------------------ +if ($http->post("action","string","xx")=="qr_refresh") { + try { + + $authenticator = new \Noalyss\OTP(); + $secret=$http->post("secret"); + echo $authenticator->compute_code($secret); + + } catch (Exception $exc) { + record_log("refresh BarCode invalide"); + } + return; + +} + // TVA id or TVA code $t=$http->get("t"); // string qcode card diff --git a/include/otp-link.php b/include/otp-link.php index a31380216..d2e43c98b 100644 --- a/include/otp-link.php +++ b/include/otp-link.php @@ -118,9 +118,15 @@ form { width:70%; margin-left:15%; } +#otp_code_span { + font-size:160%; + color:navy; + background-color:white; + padding:0.8rem; +} -
+
write($qrCode); - echo '
'; + echo '
'; // generate the QRCode echo '

',_("Scanner ceci avec votre application OTP"),'

'; + ?> + + '; + echo _("Scanner ce QRCode avec votre application OTP afin de l'ajouter"); + echo '

'; + echo '

'; + + echo _("Dans votre application OTP vous devez avoir ce nombre "); + + ?> + + compute_code($secret)?> + + + '; + ?> + ', base64_encode($result->getString())); + +} catch (Exception $exc) { + record_log($e); + return; +} +?> +

+
+

+

+ +

+

+ +

  1. FreeOTP (libre) @@ -195,22 +236,43 @@ try { Google Authenticator
- '; - echo _("Scanner ce QRCode avec votre application OTP afin de l'ajouter"); - - if ( DEBUGNOALYSS > 1) { echo "code attendu",$authenticator->code();} - echo '

'; - - - printf('', base64_encode($result->getString())); - -} catch (Exception $exc) { - record_log($e); - return; -} -?> - +

+ + +

+
    +
  1. + FreeOTP (libre) +
  2. +
+

+ PC +

+

+ + + + OTPClient , un outil très utile sous PC + +
+ + + apt install otpclient + +

+
    +
  1. + Site OTPClient + +
  2. +
+
+ \ No newline at end of file