|
@@ -0,0 +1,45 @@
|
|
|
|
|
+# Config Reference (`config.php`)
|
|
|
|
|
+
|
|
|
|
|
+This document explains what each config value is used for at runtime.
|
|
|
|
|
+
|
|
|
|
|
+## `ADMIN_EMAIL` (your specific question)
|
|
|
|
|
+
|
|
|
|
|
+`ADMIN_EMAIL` is the **fallback** recipient address for internal admin notifications.
|
|
|
|
|
+
|
|
|
|
|
+Primary recipients come from each admin account in `data/admins.json` (`email` field).
|
|
|
|
|
+The fallback is used only when no valid admin account email is available.
|
|
|
|
|
+
|
|
|
|
|
+Notification scope:
|
|
|
|
|
+
|
|
|
|
|
+- New reservation created (`sendReservationEmails()` in `includes/functions.php`)
|
|
|
|
|
+- New backorder created (`sendBackorderEmails()` in `includes/functions.php`)
|
|
|
|
|
+
|
|
|
|
|
+It is **not** used for customer login, admin login, password reset, or contact form logic.
|
|
|
|
|
+
|
|
|
|
|
+## Constant-by-constant reference
|
|
|
|
|
+
|
|
|
|
|
+| Constant | What it controls | Where it is used |
|
|
|
|
|
+|---|---|---|
|
|
|
|
|
+| `SITE_NAME` | Shop name shown in UI and email subjects/content | `includes/header.php`, `admin/login.php`, mail templates in `includes/functions.php` |
|
|
|
|
|
+| `SITE_URL` | Base path for links/assets (e.g. `/shop`) and order-history cookie path | `includes/header.php`, `includes/footer.php`, `admin/login.php`, `orders.php`, cookie path helper in `includes/functions.php` |
|
|
|
|
|
+| `DISCLAIMER_LINES` | Text lines shown on homepage disclaimer box | `index.php` |
|
|
|
|
|
+| `RESERVATION_EXPIRY_DAYS` | Number of days until a regular reservation expires | Reservation creation/conversion in `includes/functions.php` |
|
|
|
|
|
+| `ORDER_PREFIX` | Prefix for generated order IDs, format `PREFIX-YEAR-SEQ` | ID generation + validation in `includes/functions.php` |
|
|
|
|
|
+| `ORDER_HISTORY_COOKIE_NAME` | Cookie key name for browser-linked order history | `includes/functions.php` |
|
|
|
|
|
+| `ORDER_HISTORY_COOKIE_TTL_DAYS` | Retention time (days) for order-history cookie | `includes/functions.php` |
|
|
|
|
|
+| `ORDER_HISTORY_MAX_IDS` | Max remembered order IDs in history cookie | `includes/functions.php` |
|
|
|
|
|
+| `ORDER_HISTORY_COOKIE_SECRET` | HMAC signing secret for order-history cookie integrity | `includes/functions.php` |
|
|
|
|
|
+| `ADMIN_EMAIL` | Fallback recipient for admin notification emails when no valid per-admin email exists | `includes/functions.php` |
|
|
|
|
|
+| `FROM_EMAIL` | Sender + reply-to email in outgoing mails | `sendEmail()` in `includes/functions.php` |
|
|
|
|
|
+| `FROM_NAME` | Sender display name in outgoing mails | `sendEmail()` in `includes/functions.php` |
|
|
|
|
|
+| `DATA_DIR` | Base directory for JSON data files | Used to compose file constants in `config.php` |
|
|
|
|
|
+| `PRODUCTS_FILE` | Product data JSON path | Product read/write helpers in `includes/functions.php` |
|
|
|
|
|
+| `RESERVATIONS_FILE` | Reservation/backorder JSON path | Reservation read/write helpers in `includes/functions.php` |
|
|
|
|
|
+| `ADMINS_FILE` | Admin account JSON path | Admin account read/write helpers in `includes/functions.php` |
|
|
|
|
|
+
|
|
|
|
|
+## Important notes
|
|
|
|
|
+
|
|
|
|
|
+- `ORDER_HISTORY_COOKIE_SECRET` should be a long random value; changing it invalidates old browser history cookies.
|
|
|
|
|
+- `SITE_URL` should match the real subpath where the app is served. If wrong, links/assets/cookies may break.
|
|
|
|
|
+- In this codebase, admin login data is read from `data/admins.json` (`ADMINS_FILE`).
|
|
|
|
|
+ The `ADMIN_USERS` block is currently a legacy reference in comments/sample config, not active runtime auth.
|