From 113d4ce6b1a4bcde50704903916a6b17c0b5a563 Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Thu, 12 Oct 2023 14:53:29 +0700 Subject: [PATCH] OTP expired 10 minutes --- system/controllers/register.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/system/controllers/register.php b/system/controllers/register.php index 8ebd8226..b535b7eb 100644 --- a/system/controllers/register.php +++ b/system/controllers/register.php @@ -51,7 +51,8 @@ switch ($do) { if(!empty($config['sms_url'])){ $otpPath .= sha1($username.$db_password).".txt"; run_hook('validate_otp'); #HOOK - if(file_exists($otpPath) && time()-filemtime($otpPath)>300){ + //expired 10 minutes + if(file_exists($otpPath) && time()-filemtime($otpPath)>1200){ unlink($otpPath); r2(U . 'register', 's', 'Verification code expired'); }else if(file_exists($otpPath)){ @@ -134,13 +135,14 @@ switch ($do) { touch($otpPath.'index.html'); } $otpPath .= sha1($username.$db_password).".txt"; - if(file_exists($otpPath) && time()-filemtime($otpPath)<120){ + //expired 10 minutes + if(file_exists($otpPath) && time()-filemtime($otpPath)<1200){ $ui->assign('username', $username); $ui->assign('notify', '
-
Please wait '.(120-(time()-filemtime($otpPath))).' seconds before sending another SMS
'); +
Please wait '.(1200-(time()-filemtime($otpPath))).' seconds before sending another SMS
'); $ui->display('register-otp.tpl'); }else{ $otp = rand(100000,999999);