9 Commits
Author SHA1 Message Date
Hamza-AyedandClaude Opus 5 4009af8dd3 Add campaign launcher and app version manager; fix SQL injection in updatePackages
serviceapp/updatePackages.php built its UPDATE by interpolating the request
values straight into the SQL string, so any caller with a valid token could
execute arbitrary SQL through the version field. It now uses bound
parameters, requires an admin role, validates the version format, and writes
an audit entry.

trigger_campaign.php gains dry_run=1: it performs the same Gemini analysis
and target selection but returns before creating the promo code and before
dispatching any notification. Launching without previewing was the only
option before, and a launch writes a seven-day discount and pushes to every
passenger in the country.

Console:
- Campaign launcher with a mandatory preview. Launching stays disabled until
  the current parameters have been previewed, and re-locks if any parameter
  changes afterwards or once a launch completes.
- App version manager with the same version-format check as the server and a
  confirmation naming the old and new values.

Cache busting: assets are served straight off a bind mount with no version,
so browsers kept running the previously cached build after a deploy. Both
asset links now carry ?v=, and the build id is shown in Session & Security
and printed in the diagnostics report.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 14:41:27 +03:00
Hamza-Ayed 1b5d6eae44 Simplify APNs payload for iOS visible notifications and fetch latest token 2026-06-30 22:13:45 +03:00
Hamza-Ayed d9dc124c3e Fix region_name fallback based on countryCode to prevent Damascus appearing for Jordan 2026-06-30 22:00:13 +03:00
Hamza-Ayed e7785c9b2d Log FCM errors in debug_info when push notification fails 2026-06-30 21:59:00 +03:00
Hamza-Ayed cf748dfd7c Decrypt token before FCM push and fallback to SMS on push fail, also decrypt names in campaigns log 2026-06-30 21:52:15 +03:00
Hamza-Ayed de06d1cd75 Add debug counts 2026-06-30 21:48:34 +03:00
Hamza-Ayed bd13cbb905 Update targeting logic in trigger_campaign.php to fallback to parsing phone prefixes instead of relying solely on passenger_opening_locations 2026-06-30 21:30:28 +03:00
Hamza-Ayed 1ae8acad7a Update: 2026-06-30 21:12:26 2026-06-30 21:12:26 +03:00
Hamza-Ayed e73be65a72 Update: 2026-06-21 18:58:05 2026-06-21 18:58:13 +03:00