Files
Siro/backend/serviceapp/driverWhoregisterFfterCall.php
T
Hamza-AyedandClaude Opus 5 2135edcf43 Close the remaining ciphertext joins and a SQL injection in email verification
- Customer-service notes joined to the account by comparing encrypted phone
  columns. Both notes tables now carry phone_key, written when a note is
  saved, and the three joins match on it.
- The email_verifications join was comparing a plaintext column against an
  encrypted one, so it never matched and `verified` was always NULL in both
  passenger and driver sign-in. It is now resolved in PHP against the
  decrypted address, which fixes a pre-existing bug rather than only
  preparing for GCM.
- auth/sendVerifyEmail.php built all three of its statements by interpolating
  the request values into SQL. Any caller could inject through the email or
  token field. Now parameterised.
- serviceapp/register.php duplicate detection consults the users indexes and
  writes them with the row.

Sweep confirms no join or lookup compares two encrypted columns any more.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 16:48:10 +03:00

34 lines
766 B
PHP

<?php
require_once __DIR__ . '/../connect.php';
// استعلام للحصول على السائقين الذين لديهم ملاحظات في نفس الشهر الحالي
$sql = "
SELECT
d.id AS driver_id,
d.first_name,
d.last_name,
d.phone,
d.created_at,
n.note,
n.editor,
n.created_at AS note_created_at
FROM
driver d
LEFT JOIN notesForDriverService n ON n.phone_key = d.phone_key
WHERE
MONTH(d.created_at) = MONTH(CURRENT_DATE())
AND n.phone IS NOT NULL
ORDER BY
d.created_at DESC
";
$stmt = $con->prepare($sql);
$stmt->execute();
if ($stmt->rowCount() > 0) {
$row = $stmt->fetchAll(PDO::FETCH_ASSOC);
jsonSuccess($row);
} else {
jsonError("No driver records found with notes this month.");
}
?>