Update: 2026-07-14 00:34:22
This commit is contained in:
@@ -9,12 +9,8 @@ if ($transit_user_role !== 'driver') jsonError('Only drivers can access this end
|
||||
$stopId = (int)filterRequest('stop_id');
|
||||
if (!$stopId) jsonError('Missing stop_id', 400);
|
||||
|
||||
// استخرج سجل السائق من JWT — لا نثق بأي معرّف سائق من العميل
|
||||
$driverRow = $transit_con->prepare(
|
||||
"SELECT id FROM transit_drivers WHERE main_driver_id=? AND status='active' LIMIT 1"
|
||||
);
|
||||
$driverRow->execute([(string)$transit_user_id]);
|
||||
$driverRec = $driverRow->fetch();
|
||||
// استخرج سجل السائق من JWT (Redis read-through) — لا نثق بأي معرّف سائق من العميل
|
||||
$driverRec = transitResolveDriver((string)$transit_user_id);
|
||||
if (!$driverRec) jsonError('Driver not found or not active', 403);
|
||||
$transit_driver_id = (int)$driverRec['id'];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user