Fix require_once path in login.php using realpath

This commit is contained in:
Hamza-Ayed
2026-07-24 23:51:28 +03:00
parent f115292dd2
commit 1ca2c5a5dd
+18 -4
View File
@@ -1,11 +1,16 @@
<?php <?php
/** /**
* Admin/auth/login.php * Admin/auth/login.php
* تسجيل دخول المشرفين باستخدام البصمة وكلمة المرور ونظام OTP الموحد * تسجيل دخول المشرفين باستخدام البصمة وكلمة المرور ونظام OTP الموحد (Nabeh API)
*/ */
require_once __DIR__ . '/../../core/bootstrap.php'; require_once __DIR__ . '/../../core/bootstrap.php';
require_once __DIR__ . '/../../functions.php'; require_once __DIR__ . '/../../functions.php';
require_once __DIR__ . '/../../encrypt_decrypt.php';
// تحميل التشفير بأمان
$encFile = realpath(__DIR__ . '/../../encrypt_decrypt.php');
if ($encFile && file_exists($encFile)) {
require_once $encFile;
}
global $encryptionHelper; global $encryptionHelper;
if (!isset($encryptionHelper) || $encryptionHelper === null) { if (!isset($encryptionHelper) || $encryptionHelper === null) {
@@ -155,8 +160,17 @@ try {
} }
// استدعاء موزع خدمات OTP عبر Nabeh API // استدعاء موزع خدمات OTP عبر Nabeh API
require_once __DIR__ . '/../../auth/otp/providers.php'; $provFile = realpath(__DIR__ . '/../../auth/otp/providers.php');
$success = sendNabehOtp($rawPhone, $otp, 'whatsapp', 'admin'); if ($provFile && file_exists($provFile)) {
require_once $provFile;
} else {
require_once __DIR__ . '/../../auth/otp/providers.php';
}
$success = false;
if (function_exists('sendNabehOtp')) {
$success = sendNabehOtp($rawPhone, $otp, 'whatsapp', 'admin');
}
// تخزين OTP (SHA-256 hash) في جدول token_verification_admin // تخزين OTP (SHA-256 hash) في جدول token_verification_admin
$otpHash = hash('sha256', $otp); $otpHash = hash('sha256', $otp);