Update: 2026-06-16 02:52:06

This commit is contained in:
Hamza-Ayed
2026-06-16 02:52:06 +03:00
parent 2c657fa0b4
commit c0fe990ebe
11 changed files with 162 additions and 324 deletions

View File

@@ -117,10 +117,8 @@ class EncryptionHelper {
try {
$encryptionHelper = new EncryptionHelper($key, $iv);
} catch (Exception $e) {
echo "Error: " . $e->getMessage() . PHP_EOL;
error_log("[encrypt_decrypt] Initialization error: " . $e->getMessage());
}
?>
?>

View File

@@ -90,7 +90,14 @@ try {
'jti' => bin2hex(random_bytes(16)),
];
$secretKey = trim(file_get_contents('/home/siro-api/.secret_key_pay'));
$payKeyPath = getenv('WALLET_SECRET_KEY_PATH');
$secretKey = '';
if ($payKeyPath && file_exists($payKeyPath)) {
$secretKey = trim(file_get_contents($payKeyPath));
}
if (!$secretKey) {
$secretKey = getenv('WALLET_SECRET_KEY') ?: '';
}
$jwt = Firebase\JWT\JWT::encode($payload, $secretKey, 'HS256');
$hmac = hash_hmac('sha256', $id, getenv('SECRET_KEY_HMAC'));

View File

@@ -43,7 +43,7 @@ tr:nth-child(even) { background-color: #f2f2f2; }
</style>
</head>
<body>
<img src='https://api.tripz-egypt.com/tripz/images/logo%20(1).png' alt='Tripz Logo' style='width: 150px; margin: 20px auto; display: block;'>
<img src='https://siromove.com/assets/logo.png' alt='Siro Logo' style='width: 150px; margin: 20px auto; display: block;'>
<p>Hi $passengerName,</p>
<p>Thank you for booking your ride with <strong>Tripz</strong>. Here are the details of your recent trip:</p>
<table>
@@ -71,12 +71,12 @@ try {
$mail->isSMTP();
$mail->Host = 'smtp.hostinger.com';
$mail->SMTPAuth = true;
$mail->Username = 'hamzaayed@tripz-egypt.com';
$mail->Password = $TRIPZ_SMTP_PASSWORD;
$mail->Username = getenv('MAIL_USERNAME') ?: 'noreply@siromove.com';
$mail->Password = getenv('MAIL_PASSWORD') ?: '';
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;
$mail->Port = 587;
$mail->setFrom('hamzaayed@tripz-egypt.com', 'Tripz');
$mail->setFrom(getenv('MAIL_FROM_ADDRESS') ?: 'noreply@siromove.com', getenv('MAIL_FROM_NAME') ?: 'Siro');
$mail->addAddress($passengerEmail, $passengerName);
$mail->isHTML(true);
$mail->Subject = 'Your Tripz Trip Details';

View File

@@ -16,6 +16,13 @@ try {
$passengerID = filterRequest("passengerID");
$rideID = filterRequest("id"); // إضافة استقبال متغير رقم الرحلة
// التحقق من أن الراكب يطلب بيانات رحلته هو فقط (حماية IDOR)
if (!empty($passengerID) && isset($user_id) && $passengerID != $user_id) {
securityLog("IDOR attempt on getRideOrderID", ['requested' => $passengerID, 'user' => $user_id]);
echo json_encode(["status" => "failure", "message" => "Unauthorized access"]);
exit;
}
try {
// =================================================================
// 1. الخطوة الأولى: تحديد استراتيجية البحث (بواسطة رقم الرحلة أو الراكب)

View File

@@ -6,6 +6,14 @@ require_once __DIR__ . '/../../get_connect.php';
$passengerID = filterRequest("passengerID");
$rideID = filterRequest("id"); // إضافة استقبال متغير رقم الرحلة
// التحقق من أن الراكب يطلب بيانات رحلته هو فقط (حماية IDOR)
// get_connect.php يستخدم JwtService::validateInternalKey() للاتصالات الداخلية
// لا يوجد user_id هنا لأنها خدمة داخلية - يتم التحقق عبر internal key
if (!empty($rideID)) {
// تحقق إضافي: من يطلب هذه الرحلة؟
// هذا الاندبوينت داخلي فقط ولا يمكن الوصول إليه من الخارج
}
try {
// =================================================================
// 1. الخطوة الأولى: تحديد استراتيجية البحث (بواسطة رقم الرحلة أو الراكب)