From 7685323bd62a2006ecbcf256435501be223ce100 Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Mon, 21 Oct 2024 14:15:39 +0700 Subject: [PATCH] phone_otp_type forgot to add --- system/controllers/register.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/system/controllers/register.php b/system/controllers/register.php index e1737c10..01f09584 100644 --- a/system/controllers/register.php +++ b/system/controllers/register.php @@ -136,7 +136,14 @@ switch ($do) { } else { $otp = rand(100000, 999999); file_put_contents($otpPath, $otp); - Message::sendSMS($username, $config['CompanyName'] . "\n\n".Lang::T("Registration code")."\n$otp"); + if($config['phone_otp_type'] == 'whatsapp'){ + Message::sendWhatsapp($username, $config['CompanyName'] . "\n\n".Lang::T("Registration code")."\n$otp"); + }else if($config['phone_otp_type'] == 'both'){ + Message::sendWhatsapp($username, $config['CompanyName'] . "\n\n".Lang::T("Registration code")."\n$otp"); + Message::sendSMS($username, $config['CompanyName'] . "\n\n".Lang::T("Registration code")."\n$otp"); + }else{ + Message::sendSMS($username, $config['CompanyName'] . "\n\n".Lang::T("Registration code")."\n$otp"); + } $ui->assign('username', $username); $ui->assign('notify', 'Registration code has been sent to your phone'); $ui->assign('notify_t', 's');