Update: 2026-06-23 17:42:09

This commit is contained in:
Hamza-Ayed
2026-06-23 17:42:09 +03:00
parent 148ca3af1d
commit 52c4f96976
3 changed files with 12 additions and 38 deletions

View File

@@ -92,47 +92,19 @@ switch (strtolower($country)) {
case 'egypt':
$sentSuccessfully = sendKazumiSms($receiver, $otp);
if (!$sentSuccessfully) {
error_log("⚠️ [Egypt OTP Failover 1] Kazumi SMS failed. Falling back to Intaleq OTP WhatsApp.");
error_log("⚠️ [Egypt OTP Failover] Kazumi SMS failed. Falling back to Intaleq OTP WhatsApp.");
$sentSuccessfully = sendIntaleqOtp($receiver, $otp, 'whatsapp');
if (!$sentSuccessfully) {
error_log("⚠️ [Egypt OTP Failover 2] Intaleq OTP WhatsApp failed. Falling back to Nabeh JWT OTP text.");
$sentSuccessfully = sendNabehOtp($receiver, $otp, 'text');
}
}
break;
case 'syria':
// Syria uses dynamic Nabeh JWT for voice/image, static Intaleq app_key for whatsapp/sms
if ($method === 'bearer_send' || $method === 'voice' || $method === 'image') {
$sentSuccessfully = sendNabehOtp($receiver, $otp, $method);
if (!$sentSuccessfully) {
error_log("⚠️ [Syria OTP Failover] Nabeh JWT method failed. Falling back to Intaleq OTP WhatsApp.");
$sentSuccessfully = sendIntaleqOtp($receiver, $otp, 'whatsapp');
}
} else {
// Syria uses Intaleq app_key for whatsapp/sms
$sentSuccessfully = sendIntaleqOtp($receiver, $otp, $method ?: 'whatsapp');
if (!$sentSuccessfully) {
error_log("⚠️ [Syria OTP Failover] Intaleq OTP WhatsApp failed. Falling back to Nabeh JWT OTP text.");
$sentSuccessfully = sendNabehOtp($receiver, $otp, 'text');
}
}
break;
case 'jordan':
// Jordan uses dynamic Nabeh JWT for voice/image, static Intaleq app_key for sms/whatsapp
if ($method === 'bearer_send' || $method === 'voice' || $method === 'image') {
$sentSuccessfully = sendNabehOtp($receiver, $otp, $method);
if (!$sentSuccessfully) {
error_log("⚠️ [Jordan OTP Failover] Nabeh JWT method failed. Falling back to Intaleq OTP SMS.");
$sentSuccessfully = sendIntaleqOtp($receiver, $otp, 'sms');
}
} else {
$sentSuccessfully = sendIntaleqOtp($receiver, $otp, $method ?: 'sms');
if (!$sentSuccessfully) {
error_log("⚠️ [Jordan OTP Failover] Intaleq OTP SMS failed. Falling back to Nabeh JWT OTP text.");
$sentSuccessfully = sendNabehOtp($receiver, $otp, 'text');
}
}
// Jordan uses Intaleq app_key for whatsapp/sms
$sentSuccessfully = sendIntaleqOtp($receiver, $otp, $method ?: 'whatsapp');
break;
default:

View File

@@ -57,10 +57,11 @@ if ($vendorPath) require_once $vendorPath;
require_once __DIR__ . '/helpers.php';
// تحديد مسار الـ .env بشكل ديناميكي
$homeDir = realpath(__DIR__ . '/../../../');
if (!$homeDir || !is_dir($homeDir)) {
// Fallback if realpath fails
$siteUser = get_current_user();
$homeDir = "/home/$siteUser";
if (!is_dir($homeDir)) {
$homeDir = realpath(__DIR__ . '/../../../'); // Fallback
}
$envFile = getenv('ENV_FILE_PATH') ?: ($homeDir . '/.env');

View File

@@ -113,7 +113,8 @@ class LoginController extends GetxController {
Log.print('AppLink.loginFirstTime: ${AppLink.loginFirstTime}');
Log.print('payload: $payload');
Log.print('response: $response');
Log.print('response code: ${response.statusCode}');
Log.print('response body: ${response.body}');
if (response.statusCode == 200) {
final decoded = jsonDecode(response.body);