Update: 2026-06-11 13:47:39

This commit is contained in:
Hamza-Ayed
2026-06-11 13:47:40 +03:00
parent 977adfe99d
commit c5170a88d2
516 changed files with 3654 additions and 3321 deletions

View File

@@ -1,4 +1,4 @@
# Intaleq V1 - Secure Latest Version
# Siro V1 - Secure Latest Version
## File: functions.php
```
@@ -12,7 +12,7 @@ use Firebase\JWT\SignatureInvalidException;
use Firebase\JWT\BeforeValidException;
$INTERNAL_KEY = trim(file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(file_get_contents('/home/siro-api/.internal_socket_key'));
/**
@@ -27,7 +27,7 @@ $INTERNAL_KEY = trim(file_get_contents('/home/intaleq-api/.internal_socket_key')
function sendToLocationServer($action, $data) {
// رابط سيرفر اللوكيشن الداخلي أو العام
$url = "http://location.intaleq.xyz:2021";
$INTERNAL_KEY = trim(@file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(@file_get_contents('/home/siro-api/.internal_socket_key'));
$postData = [
'action' => $action,
@@ -48,7 +48,7 @@ function sendToLocationServer($action, $data) {
function findBestDrivers($con, $lat, $lng, $carType) {
// 1. الاتصال بـ Redis لجلب الأقرب
$locationServerUrl = "https://location.intaleq.xyz/api_get_nearby.php";
$INTERNAL_KEY = trim(@file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(@file_get_contents('/home/siro-api/.internal_socket_key'));
$postData = ['lat' => $lat, 'lng' => $lng, 'radius' => 5, 'limit' => 100];
@@ -162,7 +162,7 @@ function notifyDriversRideTaken($rideId, $winnerDriverId) {
// رابط سيرفر السائقين الداخلي (نفس البورت المستخدم في driver_socket.php)
$url = getenv('LOCATION_SOCKET_URL');
if (!$url) throw new RuntimeException('LOCATION_SOCKET_URL not configured');
$INTERNAL_KEY = trim(@file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(@file_get_contents('/home/siro-api/.internal_socket_key'));
$postData = [
'action' => 'ride_taken_event', // هذا الأكشن الجديد في السوكيت
@@ -185,7 +185,7 @@ function notifyDriversOnLocationServer($drivers_ids_array, $payload, $rideId = n
// رابط سيرفر اللوكيشن الخارجي
$url = getenv('LOCATION_SOCKET_URL');
if (!$url) throw new RuntimeException('LOCATION_SOCKET_URL not configured');
$INTERNAL_KEY = trim(@file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(@file_get_contents('/home/siro-api/.internal_socket_key'));
$postData = [
'action' => 'dispatch_order', // اسم الحدث المتفق عليه في socket_server.php هناك
@@ -225,7 +225,7 @@ function notifyPassengerOnRideServer($passenger_id, $payload) {
error_log("[FATAL] PASSENGER_SOCKET_URL not configured");
throw new RuntimeException('PASSENGER_SOCKET_URL not configured');
}
$INTERNAL_KEY = trim(@file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(@file_get_contents('/home/siro-api/.internal_socket_key'));
$postData = [
'action' => 'update_ride_status',
@@ -266,7 +266,7 @@ function dispatchRideToDrivers($driversData, $rideId, $payloadTemplate, $startNa
$socketUrl = getenv('LOCATION_SOCKET_URL');
if (!$socketUrl) throw new RuntimeException('LOCATION_SOCKET_URL not configured');
$internalKeyPath = '/home/intaleq-api/.internal_socket_key';
$internalKeyPath = '/home/siro-api/.internal_socket_key';
$internalKey = file_exists($internalKeyPath) ? trim(file_get_contents($internalKeyPath)) : '';
foreach ($driversData as $driver) {
@@ -377,15 +377,15 @@ function sendFcmNotification($token, $title, $body, $data, $category, $tone) {
// authenticateJWT() — النسخة النهائية الكاملة
// ───────────────────────────────────────────────────────────────
// قائمة allowedFiles مبنية على هيكل الملفات الفعلي:
// intaleq_v1/ ← الجذر
// intaleq_v1/auth/ ← مشترك راكب/سائق
// intaleq_v1/auth/syria/ ← تسجيل سوريا
// intaleq_v1/auth/captin/ ← تسجيل السائق
// siro_v1/ ← الجذر
// siro_v1/auth/ ← مشترك راكب/سائق
// siro_v1/auth/syria/ ← تسجيل سوريا
// siro_v1/auth/captin/ ← تسجيل السائق
// ═══════════════════════════════════════════════════════════════
function authenticateJWT(): object
{
$secretKey = trim(file_get_contents('/home/intaleq-api/.secret_key'));
$secretKey = trim(file_get_contents('/home/siro-api/.secret_key'));
$hmacSecret = getenv('SECRET_KEY_HMAC');
$fpPepper = getenv('FP_PEPPER');
@@ -1250,7 +1250,7 @@ CREATE TABLE `car_locations` (
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`intaleqUserDB1`@`%`*/ /*!50003 TRIGGER `trg_before_insert_car_locations` BEFORE INSERT ON `car_locations` FOR EACH ROW BEGIN
/*!50003 CREATE*/ /*!50017 DEFINER=`siroUserDB1`@`%`*/ /*!50003 TRIGGER `trg_before_insert_car_locations` BEFORE INSERT ON `car_locations` FOR EACH ROW BEGIN
SET NEW.location_point = ST_PointFromText(CONCAT('POINT(', NEW.longitude, ' ', NEW.latitude, ')'), 4326);
END */;;
DELIMITER ;
@@ -1267,7 +1267,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`intaleqUserDB1`@`%`*/ /*!50003 TRIGGER `trg_before_update_car_locations` BEFORE UPDATE ON `car_locations` FOR EACH ROW BEGIN
/*!50003 CREATE*/ /*!50017 DEFINER=`siroUserDB1`@`%`*/ /*!50003 TRIGGER `trg_before_update_car_locations` BEFORE UPDATE ON `car_locations` FOR EACH ROW BEGIN
IF NEW.latitude <> OLD.latitude OR NEW.longitude <> OLD.longitude THEN
SET NEW.location_point = ST_PointFromText(CONCAT('POINT(', NEW.longitude, ' ', NEW.latitude, ')'), 4326);
END IF;
@@ -2934,7 +2934,7 @@ try {
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>سياسة الخصوصية وشروط الخدمة Intaleq Driver</title>
<title>سياسة الخصوصية وشروط الخدمة Siro Driver</title>
<meta name="robots" content="index,follow">
<style>
body{font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;line-height:1.9;margin:24px;max-width:1000px}
@@ -2954,15 +2954,15 @@ try {
<body>
<header>
<h1>سياسة الخصوصية وشروط الخدمة تطبيق Intaleq Driver</h1>
<h1>سياسة الخصوصية وشروط الخدمة تطبيق Siro Driver</h1>
<p class="muted">آخر تحديث: 14-08-2025</p>
<p class="muted">المشغّل/المتحكم بالبيانات: <strong>انطلق لنقل الركاب</strong></p>
<p class="muted">المشغّل/المتحكم بالبيانات: <strong>سيرو لنقل الركاب</strong></p>
<p class="muted">البريد للتواصل: <a href="mailto:support@intaleqapp.com">support@intaleqapp.com</a></p>
</header>
<section class="note">
<h2>إفصاح بارز عن البيانات الحساسة الموقع الجغرافي</h2>
<p><strong>يجمع تطبيق Intaleq Driver بيانات الموقع <u>الدقيقة</u> من جهاز السائق أثناء فتح التطبيق وأيضًا أثناء عمله في الخلفية/وعند إغلاقه، لغايات إسناد الرحلات القريبة، وتتبع الرحلة حيًا، واحتساب المسافة والأجرة بدقة.</strong></p>
<p><strong>يجمع تطبيق Siro Driver بيانات الموقع <u>الدقيقة</u> من جهاز السائق أثناء فتح التطبيق وأيضًا أثناء عمله في الخلفية/وعند إغلاقه، لغايات إسناد الرحلات القريبة، وتتبع الرحلة حيًا، واحتساب المسافة والأجرة بدقة.</strong></p>
<ul>
<li><strong>في الواجهة (Foreground):</strong> عرض موقع السائق على الخريطة وإتاحة الطلبات المناسبة.</li>
<li><strong>في الخلفية/عند الإغلاق:</strong> استقبال طلبات جديدة قريبة، وتمكين تتبع الراكب للمسار، وحساب المسافة/الوقت/الأجرة.</li>
@@ -3072,7 +3072,7 @@ try {
<section>
<h2>11) إدارة الأذونات</h2>
<p>على Android: الإعدادات &gt; التطبيقات &gt; Intaleq Driver &gt; الأذونات (الموقع/الكاميرا/الصور/الإشعارات…). تعطيل بعض الأذونات قد يوقف الميزات الأساسية كاستلام الطلبات.</p>
<p>على Android: الإعدادات &gt; التطبيقات &gt; Siro Driver &gt; الأذونات (الموقع/الكاميرا/الصور/الإشعارات…). تعطيل بعض الأذونات قد يوقف الميزات الأساسية كاستلام الطلبات.</p>
</section>
<section>
@@ -3090,11 +3090,11 @@ try {
<!-- English full mirror to satisfy reviewers who prefer EN -->
<section class="ltr" dir="ltr" lang="en">
<h2>Privacy Policy (English)</h2>
<p class="muted"><strong>Last Updated:</strong> 14 Aug 2025 Data Controller: <strong>Intaleq for Passenger Transport</strong> Contact: <a href="mailto:support@intaleqapp.com">support@intaleqapp.com</a></p>
<p class="muted"><strong>Last Updated:</strong> 14 Aug 2025 Data Controller: <strong>Siro for Passenger Transport</strong> Contact: <a href="mailto:support@intaleqapp.com">support@intaleqapp.com</a></p>
<div class="note">
<h3>Prominent Disclosure Location</h3>
<p><strong>The Intaleq Driver app collects <u>precise</u> location data while the app is in the foreground and also in the background/when closed, to dispatch nearby jobs, enable live trip tracking, and accurately compute distance and fares.</strong></p>
<p><strong>The Siro Driver app collects <u>precise</u> location data while the app is in the foreground and also in the background/when closed, to dispatch nearby jobs, enable live trip tracking, and accurately compute distance and fares.</strong></p>
<ul>
<li><strong>Foreground:</strong> show driver location and enable dispatch.</li>
<li><strong>Background/closed:</strong> receive new requests, rider trip-tracking, and route/fare computation.</li>
@@ -3164,7 +3164,7 @@ try {
</section>
<footer class="muted">
<p>© 2025 انطلق لنقل الركاب جميع الحقوق محفوظة.</p>
<p>© 2025 سيرو لنقل الركاب جميع الحقوق محفوظة.</p>
</footer>
</body>
@@ -3186,7 +3186,7 @@ ini_set('memory_limit', '512M');
require_once realpath(__DIR__ . '/../vendor/autoload.php');
require_once 'load_env.php';
$env_file = '/home/intaleq-api/env/.env';
$env_file = '/home/siro-api/env/.env';
loadEnvironment($env_file);
include "encrypt_decrypt.php"; // لاستخدام $encryptionHelper
@@ -3397,7 +3397,7 @@ try {
'jti' => bin2hex(random_bytes(16)),
];
$secretKey = trim(file_get_contents('/home/intaleq-api/.secret_key_pay'));
$secretKey = trim(file_get_contents('/home/siro-api/.secret_key_pay'));
$jwt = Firebase\JWT\JWT::encode($payload, $secretKey, 'HS256');
$hmac = hash_hmac('sha256', $id, getenv('SECRET_KEY_HMAC'));
@@ -3484,7 +3484,7 @@ try {
$payload['fingerPrint'] = $fpHash;
}
$secretKey = trim(file_get_contents('/home/intaleq-api/.secret_key'));
$secretKey = trim(file_get_contents('/home/siro-api/.secret_key'));
$jwt = Firebase\JWT\JWT::encode($payload, $secretKey, 'HS256');
jsonSuccess([
@@ -3579,7 +3579,7 @@ try {
'jti' => bin2hex(random_bytes(16)),
];
$secretKey = trim(file_get_contents('/home/intaleq-api/.secret_key'));
$secretKey = trim(file_get_contents('/home/siro-api/.secret_key'));
$jwt = Firebase\JWT\JWT::encode($payload, $secretKey, 'HS256');
$hmac = hash_hmac('sha256', $id, getenv('SECRET_KEY_HMAC'));
@@ -3757,7 +3757,7 @@ try {
$payload['fingerPrint'] = $fpHash;
}
$secretKey = trim(file_get_contents('/home/intaleq-api/.secret_key'));
$secretKey = trim(file_get_contents('/home/siro-api/.secret_key'));
$jwt = Firebase\JWT\JWT::encode($payload, $secretKey, 'HS256');
jsonSuccess([
@@ -3778,7 +3778,7 @@ try {
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Intaleq - Privacy Policy & Terms</title>
<title>Siro - Privacy Policy & Terms</title>
<style>
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;500;700&display=swap');
@@ -3974,11 +3974,11 @@ try {
<section>
<h2>1. Terms of Use & Definitions</h2>
<h3>Terms of Use</h3>
<p>By downloading, browsing, or using the Intaleq application ("the App"), you agree to be bound by these Terms and Conditions. Intaleq reserves the right to modify these terms at any time. Continued use constitutes acceptance of the terms.</p>
<p>By downloading, browsing, or using the Siro application ("the App"), you agree to be bound by these Terms and Conditions. Siro reserves the right to modify these terms at any time. Continued use constitutes acceptance of the terms.</p>
<h3>Definitions</h3>
<ul>
<li><strong>"Intaleq" or "the App":</strong> Refers to the smartphone application that facilitates ride-hailing services.</li>
<li><strong>"Service Providers" (Drivers):</strong> Individuals or entities registered to provide transportation services through Intaleq.</li>
<li><strong>"Siro" or "the App":</strong> Refers to the smartphone application that facilitates ride-hailing services.</li>
<li><strong>"Service Providers" (Drivers):</strong> Individuals or entities registered to provide transportation services through Siro.</li>
<li><strong>"Users" (Passengers):</strong> Individuals who book rides through the App.</li>
<li><strong>"Services":</strong> All transportation services provided by Service Providers via the App.</li>
</ul>
@@ -3989,7 +3989,7 @@ try {
<p>We believe in full transparency regarding your data. <strong>Our use of location data is critical to our service and is explained first.</strong></p>
<div style="border: 2px solid #bee3f8; background-color: #ebf8ff; padding: 15px; border-radius: 8px; margin: 20px 0;">
<h3 style="color: #2c5282; margin-top: 0;">Prominent Disclosure: Use of Location Data</h3>
<p><strong>To provide our core ride-hailing services, the Intaleq app collects precise location data from your mobile device. Access to your location is essential for the app to function.</strong></p>
<p><strong>To provide our core ride-hailing services, the Siro app collects precise location data from your mobile device. Access to your location is essential for the app to function.</strong></p>
<p>We collect this data:</p>
<ul>
<li><strong>When the app is open and visible (in the foreground):</strong> To determine your pickup location and show you nearby drivers.</li>
@@ -4048,7 +4048,7 @@ try {
<section>
<h2>6. Disclaimer of Liability</h2>
<p>The App and services are provided <strong>"as is"</strong>. Intaleq is an intermediary platform and is <strong>not liable</strong> for the acts of any user or driver.</p>
<p>The App and services are provided <strong>"as is"</strong>. Siro is an intermediary platform and is <strong>not liable</strong> for the acts of any user or driver.</p>
</section>
<section>
@@ -4281,7 +4281,7 @@ CREATE TABLE `car_locations` (
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`intaleqLocation`@`%`*/ /*!50003 TRIGGER `trg_before_insert_car_locations` BEFORE INSERT ON `car_locations` FOR EACH ROW BEGIN
/*!50003 CREATE*/ /*!50017 DEFINER=`siroLocation`@`%`*/ /*!50003 TRIGGER `trg_before_insert_car_locations` BEFORE INSERT ON `car_locations` FOR EACH ROW BEGIN
SET NEW.location_point = ST_PointFromText(CONCAT('POINT(', NEW.longitude, ' ', NEW.latitude, ')'), 4326);
END */;;
DELIMITER ;
@@ -4298,7 +4298,7 @@ DELIMITER ;
/*!50003 SET @saved_sql_mode = @@sql_mode */ ;
/*!50003 SET sql_mode = 'NO_AUTO_VALUE_ON_ZERO' */ ;
DELIMITER ;;
/*!50003 CREATE*/ /*!50017 DEFINER=`intaleqLocation`@`%`*/ /*!50003 TRIGGER `trg_before_update_car_locations` BEFORE UPDATE ON `car_locations` FOR EACH ROW BEGIN
/*!50003 CREATE*/ /*!50017 DEFINER=`siroLocation`@`%`*/ /*!50003 TRIGGER `trg_before_update_car_locations` BEFORE UPDATE ON `car_locations` FOR EACH ROW BEGIN
IF NEW.latitude <> OLD.latitude OR NEW.longitude <> OLD.longitude THEN
SET NEW.location_point = ST_PointFromText(CONCAT('POINT(', NEW.longitude, ' ', NEW.latitude, ')'), 4326);
END IF;
@@ -7893,11 +7893,11 @@ CREATE TABLE `write_argument_after_applied_from_background` (
require_once realpath(__DIR__ . '/../vendor/autoload.php');
require_once 'load_env.php';
$env_file = '/home/intaleq-api/env/.env';
$env_file = '/home/siro-api/env/.env';
loadEnvironment($env_file);
$key = trim(file_get_contents('/home/intaleq-api/.enckey'));
$key = trim(file_get_contents('/home/siro-api/.enckey'));
$iv = getenv('initializationVector'); // 16 bytes
@@ -8012,7 +8012,7 @@ declare(strict_types=1);
error_reporting(E_ALL);
ini_set('display_errors', '0'); // لا تعرض الأخطاء في Production (ترسل لـ log)
ini_set('log_errors', '1');
ini_set('error_log', '/home/intaleq-api/logs/php_errors.log');
ini_set('error_log', '/home/siro-api/logs/php_errors.log');
header('Content-Type: application/json; charset=UTF-8');
header('X-Content-Type-Options: nosniff');
@@ -8034,7 +8034,7 @@ if ($vendorPath) require_once $vendorPath;
// 3. Helpers & Env
require_once __DIR__ . '/helpers.php';
$envFile = '/home/intaleq-api/env/.env';
$envFile = '/home/siro-api/env/.env';
loadEnvironment($envFile);
// 4. Redis Connection (Singleton)
@@ -8048,7 +8048,7 @@ try {
if ($redis->connect($redisHost, $redisPort, 1.5)) {
if ($redisPass) $redis->auth($redisPass);
$redis->setOption(Redis::OPT_PREFIX, 'intaleq:');
$redis->setOption(Redis::OPT_PREFIX, 'siro:');
} else {
$redis = null;
}
@@ -8066,7 +8066,7 @@ require_once __DIR__ . '/Auth/JwtService.php';
// لا نحمّل OtpService و FcmService إلا عند الحاجة (Lazy)
// 6. تهيئة Encryption Helper العام (للتوافقية)
$secretKey = trim(@file_get_contents('/home/intaleq-api/.secret_key')) ?: getenv('SECRET_KEY');
$secretKey = trim(@file_get_contents('/home/siro-api/.secret_key')) ?: getenv('SECRET_KEY');
if (!$secretKey) {
error_log("[FATAL] Secret key is missing.");
http_response_code(500);
@@ -8237,13 +8237,13 @@ function securityLog(string $message, array $context = []): void
{
$entry = date('Y-m-d H:i:s') . ' [SECURITY] ' . $message;
if ($context) $entry .= ' | ' . json_encode($context, JSON_UNESCAPED_UNICODE);
error_log($entry, 3, '/home/intaleq-api/logs/security.log');
error_log($entry, 3, '/home/siro-api/logs/security.log');
}
function appLog(string $message, string $level = 'INFO'): void
{
$entry = date('Y-m-d H:i:s') . " [$level] " . $message;
error_log($entry, 3, '/home/intaleq-api/logs/app.log');
error_log($entry, 3, '/home/siro-api/logs/app.log');
}
function debugLog(string $message): void
@@ -8454,7 +8454,7 @@ class JwtService
public function __construct(?Redis $redis = null)
{
$this->secretKey = trim(file_get_contents('/home/intaleq-api/.secret_key'));
$this->secretKey = trim(file_get_contents('/home/siro-api/.secret_key'));
$this->hmacSecret = getenv('SECRET_KEY_HMAC') ?: '';
$this->fpPepper = getenv('FP_PEPPER') ?: '';
$this->issuer = getenv('APP_ISSUER') ;
@@ -8617,7 +8617,7 @@ class JwtService
// ── Internal API Key — للـ get_connect.php ─────────────
public static function validateInternalKey(): void
{
$keyPath = '/home/intaleq-api/.internal_socket_key';
$keyPath = '/home/siro-api/.internal_socket_key';
$sent = $_SERVER['HTTP_X_INTERNAL_KEY'] ?? '';
$expected = file_exists($keyPath) ? trim(file_get_contents($keyPath)) : '';
@@ -8976,7 +8976,7 @@ header('Content-Type: application/json');
// !! تأكد أن هذا المفتاح يطابق المفتاح في تطبيق الأندرويد !!
//define('SECRET_KEY', 'YOUR_SUPER_SECRET_KEY_123__');
$secretKey = trim(file_get_contents('/home/intaleqapp/.secret_key'));
$secretKey = trim(file_get_contents('/home/siroapp/.secret_key'));
// --- 1. التحقق من صحة الطلب ---
$authHeader = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
@@ -9902,7 +9902,7 @@ $surveyMessage = [
"text" => "استطلاع رأي سريع 🌟"
],
"body" => [
"text" => "هل كانت تجربة التسجيل في تطبيق *انطلق* سهلة بالنسبة لك؟\n\n👇 اضغط أحد الخيارات:"
"text" => "هل كانت تجربة التسجيل في تطبيق *سيرو* سهلة بالنسبة لك؟\n\n👇 اضغط أحد الخيارات:"
],
"footer" => [
"text" => "للتواصل: +962 7XXXXXXX - رابط التطبيق: https://intaleq.xyz"
@@ -10184,7 +10184,7 @@ const MAX_FILE_MB = 5;
const ALLOWED_MIMES = ['image/jpeg','image/png','image/webp']; // فقط صور
const UPLOAD_ROOT = __DIR__ . "/../../private_uploads"; // مجلد خاص (غير عام)
const SIGN_SECRET = getenv('SECRET_KEY_HMAC'); // غيّرها واقرأها من .env
const PUBLIC_BASE = 'https://syria.intaleq.xyz/intaleq'; // الدومين العلني
const PUBLIC_BASE = 'https://syria.intaleq.xyz/siro'; // الدومين العلني
const SIGNED_TTL_SEC = 172800; // 2 days = 60*60*24
// أنشئ مجلد الرفع إن لم يكن موجودًا
@@ -10443,7 +10443,7 @@ if (is_blacklisted($con, $encryptionHelper, $receiver)) {
/* 1) Generate OTP */
$otp = rand(10000, 99999);
$messageBody = "Your verification code for Intaleq is: " . $otp;
$messageBody = "Your verification code for Siro is: " . $otp;
/* 🟢 2) Skip sending and log instead */
error_log("[send_otp] Skipping actual send. OTP generated for $receiver: $otp");
@@ -10516,7 +10516,7 @@ if (is_blacklisted($con, $encryptionHelper, $receiver)) {
}
$otp = rand(10000, 99999);
$messageBody = "Your verification code for Intaleq is: " . $otp;
$messageBody = "Your verification code for Siro is: " . $otp;
function normalize($raw) {
if (is_string($raw)) return json_decode($raw, true) ?: [];
@@ -10612,7 +10612,7 @@ $redirectUri = 'https://api.tripz-egypt.com/tripz/auth/syria/auth_proxy.php'; //
// 3. APP CONFIGURATION: Your Flutter app's custom URI scheme
// This is how the browser will redirect back to your app.
$appRedirectScheme = 'intaleqapp://auth'; // e.g., myapp://auth
$appRedirectScheme = 'siroapp://auth'; // e.g., myapp://auth
// Create a new Google Client object
$client = new Google_Client();
@@ -11479,7 +11479,7 @@ $pwdHashed = password_hash($rawSecret, PASSWORD_DEFAULT);
/* ================== 11) Notification ================== */
try {
$fcmSendUrl = 'https://api.intaleq.xyz/intaleq/ride/firebase/send_fcm.php';
$fcmSendUrl = 'https://api.intaleq.xyz/siro/ride/firebase/send_fcm.php';
$driverFullName = $raw_first_name . ' ' . $raw_last_name;
$notificationTitle = 'تسجيل سائق جديد';
@@ -11596,7 +11596,7 @@ if (is_blacklisted_driver($con, $encryptionHelper, $receiver)) {
/* 1) توليد الـ OTP */
$otp = rand(10000, 99999);
$messageBody = "Your verification code for Intaleq is: " . $otp;
$messageBody = "Your verification code for Siro is: " . $otp;
/* 🟢 2) تخطي الإرسال الفعلي */
error_log("[send_otp_driver.php] Skipping actual WhatsApp send. OTP for $receiver: $otp");
@@ -12609,7 +12609,7 @@ require_once __DIR__ . '/../../connect.php';
$id = filterRequest("id");
// استقبال بيانات شام كاش من التطبيق
$accountBank = filterRequest("accountBank"); // الاسم (مثال: intaleq)
$accountBank = filterRequest("accountBank"); // الاسم (مثال: siro)
$bankCode = filterRequest("bankCode"); // الكود الطويل (مثال: 80f23afe...)
// التحقق من وصول البيانات المطلوبة
@@ -13267,7 +13267,7 @@ if (empty($receiver)) {
}
/* 2) نصّ الرسالة وإرسالها عبر دالتك الجديدة */
$messageBody = "Your verification code for Intaleq is: " . $otp;
$messageBody = "Your verification code for Siro is: " . $otp;
$raw = sendWhatsAppFromServer($receiver, $messageBody);
$response = is_string($raw) ? json_decode($raw, true) : (array) $raw;
@@ -13324,7 +13324,7 @@ function callAPI($method, $url, $data) { /* … (أبقِها أو احذفها)
```
<?php
// File: verify_otp.php (with enhanced logging)
// intaleq_v1/auth/token_passenger
// siro_v1/auth/token_passenger
require_once __DIR__ . '/../../connect.php';
// --- Start of Script Execution ---
@@ -13505,7 +13505,7 @@ if (empty($receiver)) {
}
/* 2) نص الرسالة وإرسالها عبر دالتك الجديدة ------------------------------ */
$messageBody = "رمز التحقق الخاص بك لتطبيق انطلق درايفر هو: " . $otp;
$messageBody = "رمز التحقق الخاص بك لتطبيق سيرو درايفر هو: " . $otp;
/**
* نفترض أن sendWhatsAppFromServer() تُرجع:
@@ -13599,7 +13599,7 @@ if (!move_uploaded_file($file['tmp_name'], $uploadPath)) {
exit;
}
$imageUrl = "https://intaleq.xyz/intaleq/auth/uploads/documents/" . $uniqueName ;
$imageUrl = "https://intaleq.xyz/siro/auth/uploads/documents/" . $uniqueName ;
$imageData = file_get_contents($uploadPath);
$imageBase64 = base64_encode($imageData);
@@ -13900,7 +13900,7 @@ if (!defined('BASE_URL')) {
}
// ⚙️ مسار الرابط العام (عدّل المسار حسب نشر مشروعك)
$publicPath = "/intaleq/auth/uploads/documents/" . $uniqueName;
$publicPath = "/siro/auth/uploads/documents/" . $uniqueName;
$imageUrl = rtrim(BASE_URL, '/') . $publicPath;
// ✅ نتيجة نهائية: فقط رابط الصورة وبعض البيانات المفيدة
@@ -15284,7 +15284,7 @@ try {
// 5.5. إعداد نص الرسالة بالرقم المتغير
$messageBody = "أهلاً وسهلاً كابتن $firstName 👋\n"
. "تم تفعيل حسابك على تطبيق *انطلق*.\n"
. "تم تفعيل حسابك على تطبيق *سيرو*.\n"
. "يمكنك الآن تسجيل الدخول والبدء بالعمل مباشرة.\n"
. "للمساعدة تواصل معنا على الرقم: $phoneToUse\n" // <-- تم استخدام المتغير العشوائي هنا
. "نتمنى لك عمل موفق 🚖\n\n"
@@ -16946,7 +16946,7 @@ try {
$randomNumber = rand(1000, 999999);
$messageBody = "أهلاً وسهلاً كابتن $firstName 👋\n"
. "تم تفعيل حسابك على تطبيق *انطلق*.\n"
. "تم تفعيل حسابك على تطبيق *سيرو*.\n"
. "يمكنك الآن تسجيل الدخول والبدء بالعمل مباشرة.\n"
. "للمساعدة تواصل معنا على الرقم: $phoneToUse\n"
. "نتمنى لك عمل موفق 🚖\n\n"
@@ -17811,21 +17811,21 @@ $whatsappMessage = "";
if ($rating <= 4) {
$whatsappMessage = "أهلاً كابتن $name، 👋
نشكرك على تقييمك لتطبيق *انطلق* بـ $rating نجوم. نحن نقدر رأيك كثيراً ونسعى دائماً لتحسين خدماتنا.
نشكرك على تقييمك لتطبيق *سيرو* بـ $rating نجوم. نحن نقدر رأيك كثيراً ونسعى دائماً لتحسين خدماتنا.
إذا واجهتك أي مشاكل أو كان لديك أي اقتراحات، يسعدنا تواصلك معنا مباشرة عبر أرقام الدعم التالية لمساعدتك بشكل أفضل:
- $SERVICE_PHONE1
- $SERVICE_PHONE2
فريق انطلق";
فريق سيرو";
} else {
$whatsappMessage = "أهلاً كابتن $name، ✨
شكراً جزيلاً لتقييمك الرائع ($rating نجوم) لتطبيق **انطلق**! يسعدنا أنك تحظى بتجربة مميزة معنا.
شكراً جزيلاً لتقييمك الرائع ($rating نجوم) لتطبيق **سيرو**! يسعدنا أنك تحظى بتجربة مميزة معنا.
نتمنى لك رحلات آمنة وموفقة دائماً.
فريق انطلق";
فريق سيرو";
}
// --- الخطوة 3: إرسال رسالة الواتساب ---
@@ -17846,16 +17846,16 @@ $headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=UTF-8" . "\r\n";
$headers .= "From: $admin" . "\r\n";
$subject = "نشكرك على تقييمك لتطبيق انطلق";
$subject = "نشكرك على تقييمك لتطبيق سيرو";
$bodyEmail = "
<html><body dir='rtl' style='text-align:right;'>
<p>أهلاً كابتن $name،</p>
<p>نشكرك جزيل الشكر على تقييمك لتطبيق <strong>انطلق</strong>!</p>
<p>نشكرك جزيل الشكر على تقييمك لتطبيق <strong>سيرو</strong>!</p>
<p>لقد استلمنا تقييمك وهو <strong>$rating نجوم</strong>.</p>
<p>تعليقك: \"$comment\"</p>
<p>نحن نقدر ملاحظاتك، ونسعد دائماً بتواصلك معنا لتحسين تجربتك. إذا كان لديك أي استفسار، لا تتردد بالرد على هذا البريد.</p>
<p>مع خالص الشكر،</p>
<p>فريق انطلق.</p>
<p>فريق سيرو.</p>
</body></html>";
if (mail($email, $subject, $bodyEmail, $headers)) {
@@ -18778,7 +18778,7 @@ try {
// أ) Socket (إشعار السائق في التطبيق فوراً)
$socketUrl = 'http://188.68.36.205:2021';
$internalKeyPath = '/home/intaleq-api/.internal_socket_key';
$internalKeyPath = '/home/siro-api/.internal_socket_key';
$internalKey = file_exists($internalKeyPath) ? trim(file_get_contents($internalKeyPath)) : '';
$ch = curl_init($socketUrl);
@@ -19645,7 +19645,7 @@ require_once __DIR__ . '/../../connect.php';
// إعدادات تتبع الأخطاء (للسيرفر)
ini_set('log_errors', 1);
ini_set('error_log', '/home/intaleq-api/add_ride_error.log');
ini_set('error_log', '/home/siro-api/add_ride_error.log');
// =================================================================================
// 🛠️ دالة مساعدة: إرسال الرحلة لسوق السائقين (Marketplace Broadcast)
@@ -19656,7 +19656,7 @@ function broadcastRideToMarket($rideId, $lat, $lng, $payloadData) {
$url = "http://location.intaleq.xyz:2021";
// قراءة مفتاح الأمان الداخلي للمصادقة
$INTERNAL_KEY = trim(@file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(@file_get_contents('/home/siro-api/.internal_socket_key'));
// تجهيز البيانات بشكل (Key-Value Map) لسهولة التعامل في التطبيق والسوكيت
// ملاحظة: نستخدم القيم من $payloadData التي هي عبارة عن List حالياً
@@ -20281,7 +20281,7 @@ try {
$driverID = $rideData['driver_id'];
$status = $rideData['status'];
$secretSalt = "Intaleq_Secure_Track_2025";
$secretSalt = "Siro_Secure_Track_2025";
$generatedToken = md5(trim(strval($rideID)) . trim(strval($driverID)) . $secretSalt);
if ($token !== $generatedToken) sendError("Invalid Token");
@@ -20497,7 +20497,7 @@ try {
// test_socket_dispatch.php
$socketUrl = "http://188.68.36.205:2021";
$INTERNAL_KEY = trim(file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(file_get_contents('/home/siro-api/.internal_socket_key'));
// جرّب Driver ID موجود عندك
$driverId = 691;
@@ -22747,7 +22747,7 @@ try {
// ==========================================
$locationServerUrl = "https://location.intaleq.xyz/api_get_nearby.php";
// تأكد من المسار الصحيح للمفتاح على السيرفر الرئيسي
$INTERNAL_KEY = trim(file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(file_get_contents('/home/siro-api/.internal_socket_key'));
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $locationServerUrl);
@@ -23514,7 +23514,7 @@ usort($processed_drivers, function($a, $b) {
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<title>تقرير السائقين - Intaleq</title>
<title>تقرير السائقين - Siro</title>
<link href="https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap" rel="stylesheet">
<style>
:root {
@@ -23612,7 +23612,7 @@ usort($processed_drivers, function($a, $b) {
<div class="meta">تاريخ الطباعة: <?php echo date('Y-m-d H:i'); ?></div>
</div>
<div style="text-align: left">
<h2 style="margin:0; color: #2563eb;">Intaleq</h2>
<h2 style="margin:0; color: #2563eb;">Siro</h2>
<div class="meta dir-ltr"><?php echo $last_updated; ?> :آخر تحديث بيانات</div>
</div>
</div>
@@ -26006,8 +26006,8 @@ $prompt = "
أعد الرد بصيغة JSON فقط، بدون أي نصوص إضافية، وباللغة العربية (لهجة مصرية)، بالهيكل التالي:
{
\"customerServiceSolutions\": [\"الحل المقترح الأول\", \"الحل المقترح الثاني\"],
\"passengerReport\": { \"title\": \"بخصوص شكوتك في رحلة Intaleq\", \"body\": \"رسالة واضحة للراكب بنتيجة الشكوى\" },
\"driverReport\": { \"title\": \"بخصوص بلاغ رحلتك الأخيرة في Intaleq\", \"body\": \"رسالة واضحة للسائق بنتيجة الشكوى\" },
\"passengerReport\": { \"title\": \"بخصوص شكوتك في رحلة Siro\", \"body\": \"رسالة واضحة للراكب بنتيجة الشكوى\" },
\"driverReport\": { \"title\": \"بخصوص بلاغ رحلتك الأخيرة في Siro\", \"body\": \"رسالة واضحة للسائق بنتيجة الشكوى\" },
\"fault_determination\": \"الطرف المخطئ (الراكب/السائق/كلاهما/غير واضح)\",
\"complaint_nature\": \"طبيعة الشكوى (حقيقية/كيدية/نزاع بسيط)\",
\"complaint_type\": \"تصنيف الشكوى الذي حددته\"
@@ -29482,7 +29482,7 @@ $redisResultsMap = [];
// 1. محاولة البحث عبر Redis
try {
$locationServerUrl = "http://location.intaleq.xyz:2021";
$INTERNAL_KEY = trim(@file_get_contents('/home/intaleq-api/.internal_socket_key'));
$INTERNAL_KEY = trim(@file_get_contents('/home/siro-api/.internal_socket_key'));
$postData = [
'action' => 'get_nearby_ride_ids',
@@ -33038,7 +33038,7 @@ if (isset($_FILES['image']) && $_FILES['image']['error'] === UPLOAD_ERR_OK) {
exit;
}
$linkImage = 'https://intaleq.xyz/intaleq/Admin/adminUser/invoice_images/' . $new_filename;
$linkImage = 'https://intaleq.xyz/siro/Admin/adminUser/invoice_images/' . $new_filename;
error_log("[add_invoice.php] ✅ Image uploaded successfully: $linkImage");
}
@@ -33512,7 +33512,7 @@ if (!$passengerEmail || !filter_var($passengerEmail, FILTER_VALIDATE_EMAIL)) {
jsonError("Invalid email address");
}
$INTALEQ_SMTP_PASSWORD = getenv('INTALEQ_SMTP_PASSWORD');
$SIRO_SMTP_PASSWORD = getenv('SIRO_SMTP_PASSWORD');
// بناء محتوى الإيميل بتصميم عصري وبريميوم
$bodyEmail = "
@@ -33542,12 +33542,12 @@ $bodyEmail = "
<body>
<div class='container'>
<div class='header'>
<h1>INTALEQ</h1>
<h1>SIRO</h1>
<p>Your journey, our priority</p>
</div>
<div class='content'>
<div class='greeting'>Hello, $passengerName!</div>
<p>Thank you for choosing <strong>INTALEQ</strong>. Your trip has been successfully confirmed. Here is your digital receipt:</p>
<p>Thank you for choosing <strong>SIRO</strong>. Your trip has been successfully confirmed. Here is your digital receipt:</p>
<div class='trip-card'>
<div class='detail-row'>
@@ -33576,7 +33576,7 @@ $bodyEmail = "
<p style='margin-top: 30px;'>If you have any questions, feel free to contact our support team at any time.</p>
</div>
<div class='footer'>
<p>&copy; " . date('Y') . " INTALEQ. All rights reserved.</p>
<p>&copy; " . date('Y') . " SIRO. All rights reserved.</p>
<p>Smart Transportation Solutions</p>
</div>
</div>
@@ -33589,14 +33589,14 @@ try {
$mail->Host = 'smtp.hostinger.com';
$mail->SMTPAuth = true;
$mail->Username = $EMAIL_ADDRESS;
$mail->Password = $INTALEQ_SMTP_PASSWORD;
$mail->Password = $SIRO_SMTP_PASSWORD;
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom($EMAIL_ADDRESS, 'INTALEQ');
$mail->setFrom($EMAIL_ADDRESS, 'SIRO');
$mail->addAddress($passengerEmail, $passengerName);
$mail->isHTML(true);
$mail->Subject = 'Your INTALEQ Trip Details';
$mail->Subject = 'Your SIRO Trip Details';
$mail->Body = $bodyEmail;
$mail->send();