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>
This commit is contained in:
Hamza-Ayed
2026-07-25 02:00:14 +03:00
co-authored by Claude Opus 5
parent 852c6ece5c
commit db4ca7dd7a
10 changed files with 299 additions and 12 deletions
+38
View File
@@ -1215,3 +1215,41 @@ h1, h2, h3, h4, h5, h6 {
.coord-link { color: var(--text-muted); text-decoration: none; }
.coord-link:hover { color: var(--primary); }
/* Tariff editor */
.notice-card {
display: flex;
align-items: flex-start;
gap: 0.7rem;
font-size: 0.85rem;
color: var(--text-muted);
line-height: 1.6;
}
.notice-card i { font-size: 1.2rem; color: var(--info); flex-shrink: 0; }
.notice-danger { border-color: rgba(244, 63, 94, 0.35); }
.notice-danger i { color: var(--danger); }
.notice-card strong { color: var(--text-main); }
.tariff-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
gap: 0.9rem;
}
.tariff-field { display: flex; flex-direction: column; gap: 0.35rem; }
.tariff-label {
font-size: 0.78rem;
color: var(--text-muted);
font-weight: 500;
}
.tariff-label em {
font-style: normal;
color: var(--text-subtle);
font-size: 0.72rem;
}
.tariff-field .form-input { padding-left: 1rem; font-size: 0.9rem; }
.tariff-field .form-input:disabled { opacity: 0.65; cursor: not-allowed; }