Update: 2026-07-14 00:34:22
This commit is contained in:
@@ -12,6 +12,13 @@ $targetId = filterRequest('target_id', 'int') ?: null;
|
||||
|
||||
if (!in_array($targetType, ['all', 'route'])) $targetType = 'all';
|
||||
|
||||
// عند استهداف خط: تأكد أن الخط يخص مؤسسة هذا المشرف — يمنع البث لخط مؤسسة أخرى
|
||||
if ($targetType === 'route' && $targetId) {
|
||||
$chkRoute = $transit_con->prepare("SELECT id FROM transit_routes WHERE id=? AND org_id=? LIMIT 1");
|
||||
$chkRoute->execute([$targetId, $transit_org_id]);
|
||||
if (!$chkRoute->fetch()) jsonError('Route not found or access denied', 404);
|
||||
}
|
||||
|
||||
$fcmTopic = ($targetType === 'route' && $targetId)
|
||||
? transitRouteTopic($targetId)
|
||||
: transitOrgTopic($transit_org_id);
|
||||
|
||||
Reference in New Issue
Block a user