Commit Graph
93 Commits
Author SHA1 Message Date
Hamza-Ayed 2bacb1b9e1 تحديث شامل للوحة التحكم وإضافة كافة الميزات للـ WebSidebar 2026-07-26 03:22:47 +03:00
Hamza-AyedandClaude Opus 5 8d7e3118b5 Migrate remaining encrypted-column lookups to the blind index
Completes the set of queries that matched a freshly encrypted value against a
stored one, which only works while encryption is deterministic. Each keeps its
original comparison and adds an index comparison in the same WHERE, so nothing
changes today.

- passenger sign-in by email, service-staff sign-in, Firebase token lookup
- driver lookup by phone and by national number
- admin ride lookup and ride monitor (both tables)
- nabeh: driver status, user resolution, ride history, complaint submission

transit_org_admins lives in the transit database and has no index column, so
login there falls back to decrypting the small set of active admins and
comparing normalised numbers.

Schema: adds users.email_bidx/phone_bidx and driver.national_bidx with their
indexes.

Verified that every :*_bidx placeholder introduced is actually bound — an
unbound one is a fatal error at request time, not a silent miss.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 16:36:32 +03:00
Hamza-AyedandClaude Opus 5 c9b4d14da6 Route account lookups through the blind index and keep it fresh on write
These are the paths that must stop depending on deterministic encryption
before storage can move to AES-GCM. Each keeps its original ciphertext
comparison in the same statement, so behaviour is unchanged today and no
account becomes unreachable during the transition.

Lookups:
- auth/login.php — passenger sign-in matched the raw value against the
  encrypted column, which only works because encryptData() is CBC with a
  fixed IV.
- auth/passenger/register.php and auth/driver/register.php — duplicate
  detection. Without the index these would stop detecting existing accounts
  under GCM and allow the same phone to register twice.

Writes now populate the index in the same statement as the value:
- both registration paths write phone/email/name indexes with the row;
  driver indexes are computed before the encryption pass, since the raw
  values are unavailable afterwards.
- passenger profile update and admin driver update refresh the index when
  the underlying field changes. For the composite name index the untouched
  half is read back from the row.

Adds --audit to the backfill script: recomputes every index from its
encrypted value and reports missing or stale entries. Drift here is silent
by nature — it surfaces only when a real search fails.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 16:04:40 +03:00
Hamza-AyedandClaude Opus 5 db4ca7dd7a Fix dashbord.php parse error; require super_admin on pricing and crypto tools
Hotfix: a comment added to the dashboard SQL contained double quotes inside
the double-quoted PHP string, terminating it and making dashbord.php fail to
parse. Production was returning a parse error for every dashboard request.

Authorisation gaps closed — connect.php only proves a token is valid, it does
not check what the caller is allowed to do:

- Admin/ggg.php decrypts any database field and was authorised solely by an
  admin phone number sent in the request body. Anyone who knew a listed
  number could decrypt platform data without signing in. It now runs behind
  connect.php, requires super_admin, keeps the phone list as a second factor,
  and records every use.
- ride/kazan/update.php, kazan/add.php and ride/promo/{add,update,delete}.php
  changed live pricing and discount codes with no role check at all, so any
  valid token — including a driver's or passenger's — could rewrite the fare
  table. All now require super_admin.

Staff/pending.php: adminUser has no `status` column in this deployment, so
the query failed with an opaque "unavailable". It now checks for the column
and reports the actual reason.

Console: Kazan tariff editor for super admins — sends only changed fields,
shows an old → new confirmation before saving, and stays read-only with an
explanatory notice for plain admins.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-25 02:00:14 +03:00
Hamza-Ayed 474c212bcb refactor: migrate amount fields to decimal and implement location service restriction for unsupported regions 2026-07-24 15:08:37 +03:00
Hamza-Ayed e7629a9eb9 Update: 2026-07-23 22:14:10 2026-07-23 22:14:10 +03:00
Hamza-Ayed 695d6d7cb2 Update: 2026-07-23 21:18:25 2026-07-23 21:18:25 +03:00
Hamza-Ayed e7aa28fe3d Update: 2026-07-23 21:05:22 2026-07-23 21:05:22 +03:00
Hamza-Ayed 12a1cbc98c Update: 2026-07-23 20:15:22 2026-07-23 20:15:22 +03:00
Hamza-Ayed c35b350b31 Update: 2026-07-23 16:56:57 2026-07-23 16:56:58 +03:00
Hamza-Ayed e5bf70fddb Update: 2026-07-23 02:14:58 2026-07-23 02:14:58 +03:00
Hamza-Ayed a7fa40dc31 Update: 2026-07-23 00:11:36 2026-07-23 00:11:37 +03:00
Hamza-Ayed b86f95c90d Update: 2026-07-22 23:27:18 2026-07-22 23:27:18 +03:00
Hamza-Ayed f76623a25e Update: 2026-07-22 18:20:33 2026-07-22 18:20:33 +03:00
Hamza-Ayed f62716b510 Update: 2026-07-22 18:11:54 2026-07-22 18:11:54 +03:00
Hamza-Ayed 771b436c69 Update: 2026-07-22 17:58:19 2026-07-22 17:58:19 +03:00
Hamza-Ayed 939c7a9c2c Update: 2026-07-22 17:49:27 2026-07-22 17:49:28 +03:00
Hamza-Ayed ccbe3ab88d Update: 2026-07-22 16:01:21 2026-07-22 16:01:21 +03:00
Hamza-Ayed 6282be37d8 Fix get.php key loading fallback 2026-07-22 04:03:37 +03:00
Hamza-Ayed 8ec0ac2942 Update: 2026-07-22 01:35:37 2026-07-22 01:35:37 +03:00
Hamza-Ayed 521d76c4cf Update: 2026-07-22 00:48:30 2026-07-22 00:48:30 +03:00
Hamza-Ayed 540e77984b Update: 2026-07-22 00:44:11 2026-07-22 00:44:11 +03:00
Hamza-Ayed bec8089fd1 Update: 2026-07-22 00:42:09 2026-07-22 00:42:09 +03:00
Hamza-Ayed 16101927e1 Update: 2026-07-22 00:39:28 2026-07-22 00:39:28 +03:00
Hamza-Ayed 58222fbf81 Update: 2026-07-22 00:37:03 2026-07-22 00:37:03 +03:00
Hamza-Ayed bcab0ea221 Update: 2026-07-22 00:36:04 2026-07-22 00:36:05 +03:00
Hamza-Ayed b18fd027b6 Update: 2026-07-10 03:04:06 2026-07-10 03:04:06 +03:00
Hamza-Ayed a526dae042 Update: 2026-07-09 04:13:14 2026-07-09 04:13:14 +03:00
Hamza-Ayed 70718946f5 Update: 2026-07-09 03:41:48 2026-07-09 03:41:48 +03:00
Hamza-Ayed 7dff7b6973 Update: 2026-07-09 01:55:25 2026-07-09 01:55:25 +03:00
Hamza-Ayed d452f9baa9 feat: integrate seasonal surge multipliers and grid-specific commission discounts into pricing logic 2026-07-08 23:23:44 +03:00
Hamza-Ayed 21877153eb feat: harden backend security with HMAC verification, SSL validation, and documentation updates while removing legacy scripts. 2026-07-08 22:10:01 +03:00
Hamza-Ayed 628e169552 Update: 2026-07-07 04:57:50 2026-07-07 04:57:51 +03:00
Hamza-Ayed d6ab09c19b Update: 2026-07-06 18:23:46 2026-07-06 18:23:46 +03:00
Hamza-Ayed 9d7e2b412e Update: 2026-07-06 02:55:17 2026-07-06 02:55:17 +03:00
Hamza-Ayed 8b5daf6566 Update: 2026-07-06 02:52:45 2026-07-06 02:52:46 +03:00
Hamza-Ayed 47a6fbb308 Update: 2026-07-06 02:43:48 2026-07-06 02:43:48 +03:00
Hamza-Ayed 035fa5c209 Update: 2026-07-06 02:40:45 2026-07-06 02:40:45 +03:00
Hamza-Ayed 785802221a Update: 2026-07-06 02:37:04 2026-07-06 02:37:05 +03:00
Hamza-Ayed 61e7787d54 Update: 2026-07-06 02:31:40 2026-07-06 02:31:40 +03:00
Hamza-Ayed 775d6dd0f3 Update: 2026-07-06 02:24:21 2026-07-06 02:24:21 +03:00
Hamza-Ayed 7bcfed3ce1 Update: 2026-07-06 02:17:53 2026-07-06 02:17:53 +03:00
Hamza-Ayed 6dccb63178 Update: 2026-07-06 02:13:27 2026-07-06 02:13:28 +03:00
Hamza-Ayed ac50598ee0 Update: 2026-07-06 02:07:30 2026-07-06 02:07:30 +03:00
Hamza-Ayed 8d9126bb45 Update: 2026-07-06 02:04:01 2026-07-06 02:04:01 +03:00
Hamza-Ayed c24e921bac Update: 2026-07-06 01:47:37 2026-07-06 01:47:37 +03:00
Hamza-Ayed e7453cb6f9 Update: 2026-07-06 01:31:52 2026-07-06 01:31:53 +03:00
Hamza-Ayed bec8f61d70 Update: 2026-07-06 01:28:23 2026-07-06 01:28:23 +03:00
Hamza-Ayed d00502769a Update: 2026-07-06 00:53:15 2026-07-06 00:53:15 +03:00
Hamza-Ayed 3e0b4cbf64 Update: 2026-07-04 18:43:56 2026-07-04 18:43:57 +03:00