Email Verification when change email

This commit is contained in:
Ibnu Maksum
2024-08-19 14:21:21 +07:00
parent da985f27e1
commit 0d966a5e03
7 changed files with 314 additions and 130 deletions

View File

@ -22,7 +22,7 @@ switch ($do) {
$password = _post('password');
$cpassword = _post('cpassword');
$address = _post('address');
if (!empty($config['sms_url'])) {
if (!empty($config['sms_url']) && $_c['allow_phone_otp'] == 'yes') {
$phonenumber = Lang::phoneFormat($username);
$username = $phonenumber;
} else if (strlen($username) < 21) {
@ -45,7 +45,7 @@ switch ($do) {
$msg .= Lang::T('Passwords does not match') . '<br>';
}
if (!empty($config['sms_url'])) {
if (!empty($config['sms_url']) && $_c['allow_phone_otp'] == 'yes') {
$otpPath .= sha1($username . $db_pass) . ".txt";
run_hook('validate_otp'); #HOOK
//expired 10 minutes
@ -111,7 +111,7 @@ switch ($do) {
break;
default:
if (!empty($config['sms_url'])) {
if (!empty($config['sms_url']) && $_c['allow_phone_otp'] == 'yes') {
$username = _post('username');
if (!empty($username)) {
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();