From c76098964618be5386ab60c7575abeda143bf446 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Sun, 10 Aug 2025 22:26:42 +0200 Subject: [PATCH] OTP : can specify another url --- include/class/noalyss_user.class.php | 6 ++++-- include/constant.php | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/class/noalyss_user.class.php b/include/class/noalyss_user.class.php index f26aafb2a..69498d3db 100644 --- a/include/class/noalyss_user.class.php +++ b/include/class/noalyss_user.class.php @@ -2063,13 +2063,15 @@ Voici votre code secret pour NOALYSS : $code } /** * @brief send an email with link to the user + * @param $base_url (string) http url to scan the QRCode, the url in the + * mail will be {$base_url}/index.php?otp={$uuid} */ - function send_link_otp() { + function send_link_otp($base_url=null) { $mail = new \Sendmail(); $mail->set_from(ADMIN_WEB); $mail->mailto($this->getEmail()); $mail->set_subject(_("NOALYSS : Double authentification lien pour 2FA: OTP")); - $noalyss_url = NOALYSS_URL; + $noalyss_url = $base_url??NOALYSS_URL; $uuid = guidv4(); $valid_time=new \DateTime(); $valid_time->add(new \DateInterval('PT12H')); diff --git a/include/constant.php b/include/constant.php index d98118705..92d447d82 100644 --- a/include/constant.php +++ b/include/constant.php @@ -376,7 +376,7 @@ if (!defined("DEFAULT_SERVER_VIDEO_CONF")) { } define ("VATCHECK_URL","https://ec.europa.eu/taxation_customs/vies/rest-api/"); - + /** * @brief load automatically class *