Hi,
I activated two factor authentication (2FA) by sms, using my own class that I puted in global codes server event. I receive the following error when I try to login:C:\xampp\htdocs\telehealth\src\SmsTwoFactorAuthentication.php(42): Call to undefined method PHPMaker2024\TELEHEALTH\PedraSMS::load()what’s the problem?
class PedraSMS extends Sms {
// Send SMS
public function send() {
$phoneNumber = $this->Recipient; // Get phone number
$message = $this->Content; // Get SMS content
try {
date_default_timezone_set("Asia/Tehran");
// your panel configuration
$conf = new Configuration;
$conf->setConfig("SMSAPI");
$APIKey = $conf->ConfigValue;
$conf->setConfig("SMSKEY");
$SecretKey = $conf->ConfigValue;
$conf->setConfig("LOGINSMS");
$templateID = $conf->ConfigValue;
// message data
$data = array(
"ParameterArray" => array(
array(
"Parameter" => "VerificationCode",
"ParameterValue" => $message
)
),
"Mobile" => $phoneNumber,
"TemplateId" => $templateID
);
$SmsIR_UltraFastSend = new SmsIR_UltraFastSend($APIKey,$SecretKey);
$UltraFastSend = $SmsIR_UltraFastSend->UltraFastSend($data);
} catch (Exeption $e) {
echo 'Error UltraFastSend : '.$e->getMessage();
}
return true; // Send successful
}
}
Config("SMS_CLASS", PROJECT_NAMESPACE . "PedraSMS"); // Replace the default Sms class by your own class
Config("SMS_REGION_CODE", "+98"); // Override default SMS region code to GB
C:\xampp\htdocs\telehealth\src\SmsTwoFactorAuthentication.php(42): Call to undefined method PHPMaker2024\TELEHEALTH\PedraSMS::load()
But the error message said it cannot find Sms::load(), you better open src\Sms.php in your project folder with a text editor and check the source code. In the template, the Sms.php does have public function load().Make sure the namespaces of the src\Sms.php and the global code (i.e. src\userfn.php) are the same (i.e. PHPMaker2024\TELEHEALTH).
Hi,
The sms/email OTP codes works fine but there is another problem with both email/sms OTP codes.
When I try to list the backup codes I receive the following error message:SyntaxError: Unexpected token ‘<’, “”… is not valid JSONThanks