From f99768bcb6f060b3f5c9b067f7f9cc56962cfbc0 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Sat, 5 Dec 2026 03:37:49 -0500 Subject: [PATCH] CrowdSec no longer blocks new tickets and recurring tickets: the work-booking fields CrowdSec's copy of the OWASP Core Rule Set took for the Unix command sched are renamed book_at, book_minutes, book_onsite, book_time and book_agent in New Ticket, Dispatch's link to it, the Schedule window, the helper window and recurring tickets, the cron job window's field is job_schedule, the tickets list's Scheduled tab is show=booked, Maintenance > Cron sorts by when, and Stripe Checkout returns with checkout in place of session_id, each still accepting the old name; CONTRIBUTING.md rule and 26.12.6 changelog --- CHANGELOG.md | 2 ++ CONTRIBUTING.md | 2 ++ admin/cron.php | 18 +++++++++++------- admin/modals/cron/cron_edit.php | 2 +- admin/post/cron.php | 3 ++- agent/includes/inc_recurring_ticket_ahead.php | 6 +++--- agent/js/dispatch.js | 5 +++-- agent/modals/ticket/ticket_add.php | 10 ++++++---- agent/modals/ticket/ticket_edit_schedule.php | 6 +++--- agent/modals/ticket/ticket_helper.php | 4 ++-- agent/post/recurring_ticket.php | 8 +++++--- agent/post/ticket.php | 11 ++++++----- agent/post/ticket_helper.php | 4 ++-- agent/tickets.php | 6 +++++- client/post.php | 5 +++-- functions/billing_pay.php | 2 +- functions/card_expiry.php | 2 +- guest/guest_post.php | 16 +++++++++++++--- 18 files changed, 71 insertions(+), 41 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da2d0e34d..44442411e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Update from Maintenance > Update as usual. This release has four database change - Email and phone links work in Knowledge Base articles and documents - a `mailto:` or `tel:` link showed as plain text on the published article, in the client portal and on the document, while the editor still had it. Those in an article or document written in Markdown were taken out when it was saved; the database update puts them back in the ones already saved, so they don't need saving again. Email and phone links in ticket replies, such as those in an email signature, work too. - Opening one of your own vendors from a client's license or service works - it said there was nothing to see. - A ticket's other assets show on it when its main asset was taken off - they were still on the ticket but not listed. +- Behind CrowdSec's web application firewall, creating a ticket or a recurring ticket got you blocked, and soon banned, whatever you wrote in it. CrowdSec took the names of the fields that book the work - when, for how long, remote or onsite - for a Linux command, as they began with "sched", and so blocked the post. The same stopped the ticket's Schedule window, adding an agent to help at their own time, the **Scheduled** tab of the tickets list, sorting Maintenance > Cron by **Schedule** and saving a cron job. Those fields have new names, so nothing needs excluding in CrowdSec: any exclusion you added for this can come out. Stripe's return to ITFlow after a client saves a card or sets up autopay is renamed too, as the same firewall can take it for an attack when the browser doesn't say where it came from. ### Developer Updates @@ -60,6 +61,7 @@ Update from Maintenance > Update as usual. This release has four database change - Vendors permission: `module_vendor` (database 4.4.6, module 9 on a fresh install, `setup/seed_data.php` - Technician Read, Accountant Full); 4.4.6 gives every role `max(1, its module_financial level)`. In `functions/vendor.php`, `vendorPermissionReady()` (4.4.6) switches `vendorModule(0)` from `module_financial` to `module_vendor`, and `vendorCan(0, 1)` from always-yes to the permission; `vendorEnforce(0, $level)` enforces it at every level. `vendorIsOurs($vendor_id)` (one query a page) and `vendorCanOpen($vendor_id)` decide whether a mention of a vendor opens: `vendorLink()` and the new `vendorNameHtml()` show the name without a link, and `vendorRedact($row, $vendor_id)` blanks a row's `vendor_phone`, `vendor_account_number`, `vendor_code`, `vendor_email`, contacts and hours - used by `agent/network.php`, `agent/license.php`, `agent/ticket.php`, `agent/service.php` and the network, license and service quick looks. `vendorLink()` no longer puts a client's id on a page link to one of ours. The ours list (`agent/vendors.php`), its export, the vendor quick look and global search's Vendors group check it; the side nav's Vendors goes to `vendors.php?view=clients` without it. `roleModules()` lists modules in `roleModuleInfo()`'s order, then by id. - Linked assets: `asset_links` (database 4.4.7) keeps each link as two rows, (`asset_id`, `linked_asset_id`) and the reverse, both `ON DELETE CASCADE`. `functions/asset_link.php` has `assetLinksReady()` (4.4.7), `assetLinked($asset_id)` (the client's assets, not archived), `assetLinkedNames($asset_ids)` for a list in one query, `assetLinkedTo()`, `assetLinkAdd($asset_id, $ids)` and `assetLinkRemove($asset_id, $other_id)` - each writes an `asset_history` row on both sides and `logAudit('Asset', 'Link')` or `'Unlink'` - and `assetLinkedListHtml()` for the card. The link picker (`functions/link_picker.php`) takes `asset|asset` in `LINK_PICKER_OWN`, with Support at Modify; it is kept out of `LINK_RELATIONS`, whose code assumes two different kinds. `agent/post/asset.php` adds `unlink_asset_link` and `move_linked_asset`, which sets one asset's location to the other's through `assetQuickSet()`, and `bulk_transfer_client_asset` copies the links between the assets it moves to their new copies. `clientExportLinks()` lists each pair once. - Ticket assets: New Ticket, Edit Ticket, `agent/modals/ticket/ticket_edit_asset.php` and both recurring ticket windows post one `assets[]` multi-select, an `assets_form` marker and `asset_main`, in place of `asset_id` (`asset` in the Assets window) and `additional_assets[]`. The tables are unchanged. `ticketAssetsPosted($client_id, $main_field)` (`functions/ticket.php`) reads it - the client's own in the order posted, `asset_main` kept as `ticket_asset_id` while it is picked, else the first, the rest to `ticket_assets` - and still reads the old fields. `ticketAssetsSave()` writes both and notes the assets added and removed in `ticket_history`; `ticketOtherAssetIds()` lists the others by name; `ticketAssetsFieldHtml()` draws the field for the edit windows. `agent/js/tickets_add_modal.js` fills one `#assetSelect` and keeps the first asset picked in `#assetMain`. `remove_ticket_asset` (`delete_ticket_additional_asset` still works) takes the main asset off too, the first of the others by name taking its place. The tickets list search also looks through `ticket_assets`, and the ticket quick look (`agent/modals/ticket/ticket.php`) lists them. +- Field and parameter names CrowdSec's copy of the OWASP Core Rule Set blocks: the `appsec-crs` collections install CRS 4.0.0-rc1 from crowdsecurity/sec-lists, whose rule 932260 matches `sched` at the start of any argument's name or value (upstream CRS has dropped it as a false positive). Renamed: New Ticket's `schedule` and `schedule_minutes` to `book_at` and `book_minutes`, which Dispatch's link to it uses too; the Schedule window's `scheduled_date_time`, `schedule_tech` and `schedule_minutes` to `book_at`, `book_agent` and `book_minutes`; the helper window's to `book_at` and `book_minutes`; recurring tickets' `schedule_time`, `schedule_minutes` and `schedule_onsite` to `book_time`, `book_minutes` and `book_onsite` (`agent/includes/inc_recurring_ticket_ahead.php`); the cron job window's `schedule` to `job_schedule`; the tickets list's `show=scheduled` to `show=booked`; and Maintenance > Cron's `sort=schedule` to `sort=when`. Stripe Checkout's return URLs carry `checkout={CHECKOUT_SESSION_ID}` in place of `session_id`, which rule 943120 blocks when there is no Referer (`guestCheckoutSessionId()` in `guest/guest_post.php`). Each handler and page still reads the old name. Every field name, URL parameter and link value in the code was put through CrowdSec's Coraza fork (v3.8.1-crowdsec.20261110) with its CRS 4.0.0-rc1 and 4.31.0 at paranoia level 1, and nothing else matches. CONTRIBUTING.md has the rule. ## [26.12.5] diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 89a21c8d3..ec95daa5d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -272,6 +272,8 @@ Two standing exceptions: junction tables (`client_tags`, `service_assets`, …) **Read an uploaded CSV through `csvTextToUtf8()`.** Excel's plain CSV is Windows-1252 on Windows and Mac Roman on a Mac, and its Unicode Text is UTF-16. Read raw, an accented letter turns into `?` at the first `mb_substr()`, or breaks `json_encode()` outright. `importFile()` does it for the Import window. Anything reading `$_FILES` itself puts the text through `csvTextToUtf8()` and `fgetcsv()`s it from `php://temp`, as `expenseImportRead()`, `agent/post/network_ip.php` and `agent/post/asset_interface.php` do. `escapeSql()`'s Windows-1252 fallback works on one value at a time, so it can't tell a Mac file from a Windows one. +**Don't start a field name, or a value in an address, with a Unix command's name.** CrowdSec's web application firewall runs its own copy of the OWASP Core Rule Set - the `appsec-crs` collections install CRS 4.0.0-rc1 from crowdsecurity/sec-lists - whose rule 932260 blocks a request when any field or URL parameter's name or value starts with a command on its list, and bans whoever sends a few. `sched` is on it, so a field named `schedule_minutes` blocked every new ticket. The booking fields are `book_at`, `book_minutes`, `book_onsite`, `book_time` and `book_agent`, the tickets list's tab is `show=booked` and Maintenance > Cron sorts by `when`. Before using a name that starts with a word like that, check it against `appsec/crs/4.0.0-rc1/REQUEST-932-APPLICATION-ATTACK-RCE.conf` in that repo. What an editor holds is a separate case - it goes as a file beside the form (`itflowFields` in `js/http.js`). + **Schema changes require two edits in one PR:** 1. `db.sql` — so fresh installs get the new schema. diff --git a/admin/cron.php b/admin/cron.php index 5b37ca537..7d22b1262 100644 --- a/admin/cron.php +++ b/admin/cron.php @@ -16,8 +16,9 @@ * there is nothing to change about it until cron has run once. */ -// The list: by schedule until a heading is clicked - the every-minute jobs, then the day's in the order they run -$sort = "schedule"; +// The list: by schedule until a heading is clicked - the every-minute jobs, then the day's in the order they run. +// Its key is when, not schedule: a web application firewall takes a value starting sched for the Unix command. +$sort = "when"; $order = "ASC"; require_once "includes/inc_all_admin.php"; @@ -233,23 +234,26 @@ $command_block = function () use ($cron_command) { }; $owner_note = $file_owner !== '' ? ' (' . escapeHtml($file_owner) . ' here)' : ''; -// The list - only these sort; anything else asked for falls back to the schedule +// The list - only these sort; anything else asked for falls back to the schedule (schedule is when's name from before) +if ($sort === 'schedule') { + $sort = 'when'; +} $sort_keys = [ 'job' => function ($job) { return strtolower($job['label']); }, - 'schedule' => function ($job) { return $job['schedule'] === 'Daily' ? 100000 + intval(substr($job['daily_at'], 0, 2)) * 60 + intval(substr($job['daily_at'], 3, 2)) : $job['interval_minutes']; }, + 'when' => function ($job) { return $job['schedule'] === 'Daily' ? 100000 + intval(substr($job['daily_at'], 0, 2)) * 60 + intval(substr($job['daily_at'], 3, 2)) : $job['interval_minutes']; }, 'last_run' => function ($job) { return $job['last_run_at'] ? strtotime($job['last_run_at']) : 0; }, // What needs a look first 'status' => function ($job) { return array_search($job['state'], ['failed', 'lost', 'queued', 'running', 'paused', 'skipped', 'never', 'completed', 'unused'], true); }, ]; if (!isset($sort_keys[$sort])) { - $sort = 'schedule'; + $sort = 'when'; } uasort($jobs, function ($a, $b) use ($sort_keys, $sort, $order) { $compared = $sort_keys[$sort]($a) <=> $sort_keys[$sort]($b); return ($order === 'DESC' ? -$compared : $compared) ?: $a['position'] <=> $b['position']; }); // A heading sorts its own way round first - names A to Z, the latest run and what needs a look at the top - then the other -$sort_first = ['job' => 'ASC', 'schedule' => 'ASC', 'last_run' => 'DESC', 'status' => 'ASC']; +$sort_first = ['job' => 'ASC', 'when' => 'ASC', 'last_run' => 'DESC', 'status' => 'ASC']; $sort_link = function ($column, $label) use ($sort_first) { return sortLink($column, $label, $sort_first[$column] ?? null); }; @@ -387,7 +391,7 @@ $status_looks = [ - + diff --git a/admin/modals/cron/cron_edit.php b/admin/modals/cron/cron_edit.php index d99774e7d..100270089 100644 --- a/admin/modals/cron/cron_edit.php +++ b/admin/modals/cron/cron_edit.php @@ -51,7 +51,7 @@ ob_start();
- diff --git a/admin/post/cron.php b/admin/post/cron.php index 592a27bd1..cc07fb3b5 100644 --- a/admin/post/cron.php +++ b/admin/post/cron.php @@ -47,7 +47,8 @@ if (isset($_POST['edit_cron_job'])) { $cron_job_name = escapeSql($row['cron_job_name']); $enabled = isset($_POST['enabled']) ? 1 : 0; - $schedule = $_POST['schedule'] === 'Daily' ? 'Daily' : 'Interval'; + // (job_schedule - a web application firewall takes a field named sched... for the Unix command; schedule is from before) + $schedule = ($_POST['job_schedule'] ?? $_POST['schedule'] ?? '') === 'Daily' ? 'Daily' : 'Interval'; // A job the registry marks interval-unsafe only accepts the daily schedule. The form // does not offer anything else, so anything else arriving here is a crafted request diff --git a/agent/includes/inc_recurring_ticket_ahead.php b/agent/includes/inc_recurring_ticket_ahead.php index e9d381ce0..89805b6e3 100644 --- a/agent/includes/inc_recurring_ticket_ahead.php +++ b/agent/includes/inc_recurring_ticket_ahead.php @@ -25,15 +25,15 @@ if (recurringAheadReady()) {
- + - $label) { ?> - diff --git a/agent/js/dispatch.js b/agent/js/dispatch.js index cc8803cf2..e0d82b6c1 100644 --- a/agent/js/dispatch.js +++ b/agent/js/dispatch.js @@ -660,8 +660,9 @@ cal.unselect(); const params = new URLSearchParams({ assigned_to: String(agentId), - schedule: ymd(info.start) + 'T' + hm(info.start), - schedule_minutes: String(Math.round((info.end - info.start) / 60000)), + // Not schedule... - a web application firewall takes a name starting sched for the Unix command + book_at: ymd(info.start) + 'T' + hm(info.start), + book_minutes: String(Math.round((info.end - info.start) / 60000)), return_to: 'dispatch' }); openModal('modals/ticket/ticket_add.php?' + params.toString()); diff --git a/agent/modals/ticket/ticket_add.php b/agent/modals/ticket/ticket_add.php index 515fad103..40175b588 100644 --- a/agent/modals/ticket/ticket_add.php +++ b/agent/modals/ticket/ticket_add.php @@ -25,8 +25,10 @@ $contact_id = intval($_GET['contact_id'] ?? 0); // From a drag over empty time on Dispatch: that agent, booked for that time on the viewer's own // clock, for that long - and back to Dispatch once it is saved $prefill_assigned_to = isset($_GET['assigned_to']) && preg_match('/^\d+$/', (string) $_GET['assigned_to']) ? intval($_GET['assigned_to']) : intval($session_user_id); -$prefill_schedule = preg_match('/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/', (string) ($_GET['schedule'] ?? '')) ? (string) $_GET['schedule'] : ''; -$prefill_schedule_minutes = $prefill_schedule !== '' ? ticketScheduleMinutesValue($_GET['schedule_minutes'] ?? 0) : CALENDAR_TICKET_MINUTES; +// (book_at and book_minutes - a web application firewall takes a name starting sched... for the Unix command) +$prefill_book_at = (string) ($_GET['book_at'] ?? $_GET['schedule'] ?? ''); +$prefill_schedule = preg_match('/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}$/', $prefill_book_at) ? $prefill_book_at : ''; +$prefill_schedule_minutes = $prefill_schedule !== '' ? ticketScheduleMinutesValue($_GET['book_minutes'] ?? $_GET['schedule_minutes'] ?? 0) : CALENDAR_TICKET_MINUTES; $return_to = ($_GET['return_to'] ?? '') === 'dispatch' ? 'dispatch' : ''; $project_id = intval($_GET['project_id'] ?? 0); $asset_id = intval($_GET['asset_id'] ?? 0); @@ -322,8 +324,8 @@ ob_start();
- - + > + >
@@ -50,7 +50,7 @@ ob_start();
- @@ -64,7 +64,7 @@ ob_start();
- $label) { ?> diff --git a/agent/modals/ticket/ticket_helper.php b/agent/modals/ticket/ticket_helper.php index 14b26e0a1..42ead9cb2 100644 --- a/agent/modals/ticket/ticket_helper.php +++ b/agent/modals/ticket/ticket_helper.php @@ -100,14 +100,14 @@ ob_start();
- +
- $label) { ?> diff --git a/agent/post/recurring_ticket.php b/agent/post/recurring_ticket.php index 211b91088..b7c1c6b2c 100644 --- a/agent/post/recurring_ticket.php +++ b/agent/post/recurring_ticket.php @@ -55,11 +55,13 @@ function recurringTicketFromPost($client_id, $current = null) { // Booked at a time, and made ahead (functions/ticket.php) - before the 1st of the month for month-based repeats only $ahead = ''; if (recurringAheadReady() && isset($_POST['lead_days'])) { - $time = trim((string) ($_POST['schedule_time'] ?? '')); + // (book_* - a web application firewall takes a field named sched... for the Unix command; schedule_* is from before) + $time = trim((string) ($_POST['book_time'] ?? $_POST['schedule_time'] ?? '')); + $book_minutes = $_POST['book_minutes'] ?? $_POST['schedule_minutes'] ?? null; $mode = ($_POST['lead_mode'] ?? '') === 'month' && recurringTicketMonthBased($frequency) ? 'month' : 'days'; $ahead = ", recurring_ticket_schedule_time = " . (preg_match('/^([01]\d|2[0-3]):[0-5]\d$/', $time) ? "'$time:00'" : 'NULL') - . ", recurring_ticket_schedule_onsite = " . (intval($_POST['schedule_onsite'] ?? 0) ? 1 : 0) - . (ticketScheduleEndReady() && isset($_POST['schedule_minutes']) ? ", recurring_ticket_schedule_minutes = " . ticketScheduleMinutesValue($_POST['schedule_minutes']) : '') + . ", recurring_ticket_schedule_onsite = " . (intval($_POST['book_onsite'] ?? $_POST['schedule_onsite'] ?? 0) ? 1 : 0) + . (ticketScheduleEndReady() && $book_minutes !== null ? ", recurring_ticket_schedule_minutes = " . ticketScheduleMinutesValue($book_minutes) : '') . ", recurring_ticket_lead_days = " . recurringTicketLeadDays($_POST['lead_days'], $frequency, $mode) . ", recurring_ticket_lead_mode = '$mode'"; } diff --git a/agent/post/ticket.php b/agent/post/ticket.php index 14d4c8b88..23f5274e0 100644 --- a/agent/post/ticket.php +++ b/agent/post/ticket.php @@ -67,7 +67,8 @@ if (isset($_POST['add_ticket'])) { $billable = intval($_POST['billable'] ?? 0) ? 1 : 0; $due = ticketDueSql($_POST['due'] ?? ''); // The work booked as it is made - checked before anything is saved - $schedule_input = trim((string) ($_POST['schedule'] ?? '')); + // (book_* - a web application firewall takes a field named sched... for the Unix command; schedule is from before) + $schedule_input = trim((string) ($_POST['book_at'] ?? $_POST['schedule'] ?? '')); // Typed on the agent's own clock - kept in the company's (functions/user_timezone.php) $schedule = ticketScheduleValue(timezoneFromView(str_replace('T', ' ', $schedule_input))); if ($schedule_input !== '' && $schedule === '') { @@ -195,7 +196,7 @@ if (isset($_POST['add_ticket'])) { $created_alert = "Ticket " . escapeHtml($config_ticket_prefix . $ticket_number) . " created"; if ($schedule !== '') { $booked = ticketSetSchedule(ticketRow($ticket_id), $schedule, intval($_POST['onsite'] ?? 0) ? 1 : 0, - date('Y-m-d H:i:s', strtotime($schedule) + ticketScheduleMinutesValue($_POST['schedule_minutes'] ?? 0) * 60)); + date('Y-m-d H:i:s', strtotime($schedule) + ticketScheduleMinutesValue($_POST['book_minutes'] ?? $_POST['schedule_minutes'] ?? 0) * 60)); $created_alert .= " and scheduled for " . escapeHtml($booked['when_text']); if ($booked['conflicts']) { $created_alert .= ".
The same agent already has work at that time:
" . implode(",
", array_map('escapeHtml', $booked['conflicts'])); @@ -2263,7 +2264,7 @@ if (isset($_POST['edit_ticket_schedule'])) { $row = ticketForRequest($_POST['ticket_id'] ?? 0, 2); // Typed on the agent's own clock - kept in the company's (functions/user_timezone.php) - $schedule = ticketScheduleValue(timezoneFromView(str_replace('T', ' ', trim((string) ($_POST['scheduled_date_time'] ?? ''))))); + $schedule = ticketScheduleValue(timezoneFromView(str_replace('T', ' ', trim((string) ($_POST['book_at'] ?? $_POST['scheduled_date_time'] ?? ''))))); if ($schedule === '') { flashAlert('Pick the date and time for the work.', 'error'); @@ -2275,7 +2276,7 @@ if (isset($_POST['edit_ticket_schedule'])) { } // Who does it - given to them first when it's someone new, one who can open the client's tickets - and for how long - $schedule_tech = intval($_POST['schedule_tech'] ?? $row['ticket_assigned_to']); + $schedule_tech = intval($_POST['book_agent'] ?? $_POST['schedule_tech'] ?? $row['ticket_assigned_to']); if ($schedule_tech && $schedule_tech !== intval($row['ticket_assigned_to'])) { if (!isset(ticketMentionAgents($row['ticket_client_id'])[$schedule_tech])) { flashAlert('That agent can\'t open this client\'s tickets.', 'error'); @@ -2290,7 +2291,7 @@ if (isset($_POST['edit_ticket_schedule'])) { ticketMailScheduleAgentCancelled($row); $row = ticketForRequest($row['ticket_id'], 2); } - $schedule_end = date('Y-m-d H:i:s', strtotime($schedule) + ticketScheduleMinutesValue($_POST['schedule_minutes'] ?? 0) * 60); + $schedule_end = date('Y-m-d H:i:s', strtotime($schedule) + ticketScheduleMinutesValue($_POST['book_minutes'] ?? $_POST['schedule_minutes'] ?? 0) * 60); $result = ticketSetSchedule($row, $schedule, intval($_POST['onsite'] ?? 0) ? 1 : 0, $schedule_end); diff --git a/agent/post/ticket_helper.php b/agent/post/ticket_helper.php index b7ba61cc7..0c5fe9f61 100644 --- a/agent/post/ticket_helper.php +++ b/agent/post/ticket_helper.php @@ -22,8 +22,8 @@ if (isset($_POST['save_ticket_helper'])) { $start = $end = ''; if ($mode === 'own') { // Typed on the agent's own clock - kept in the company's (functions/user_timezone.php) - $start = ticketScheduleValue(timezoneFromView(str_replace('T', ' ', trim((string) ($_POST['scheduled_date_time'] ?? ''))))); - $end = $start !== '' ? date('Y-m-d H:i:s', strtotime($start) + ticketScheduleMinutesValue($_POST['schedule_minutes'] ?? 0) * 60) : ''; + $start = ticketScheduleValue(timezoneFromView(str_replace('T', ' ', trim((string) ($_POST['book_at'] ?? $_POST['scheduled_date_time'] ?? ''))))); + $end = $start !== '' ? date('Y-m-d H:i:s', strtotime($start) + ticketScheduleMinutesValue($_POST['book_minutes'] ?? $_POST['schedule_minutes'] ?? 0) * 60) : ''; } [$ok, $message, $conflicts] = ticketHelperSave($row, intval($_POST['user_id'] ?? 0), $mode, $start, $end); diff --git a/agent/tickets.php b/agent/tickets.php index eed880ce0..e8a6512a1 100644 --- a/agent/tickets.php +++ b/agent/tickets.php @@ -211,7 +211,8 @@ $shows = [ 'title' => 'We replied last and it is with the client - or it is parked in a status that pauses the clock, like On Hold'], 'overdue' => ['label' => 'Overdue', 'icon' => 'fa-stopwatch', 'where' => ticketOverdueSql(), 'alarm' => 'danger', 'title' => 'Past its due date, or its SLA is breached'], - 'scheduled' => ['label' => 'Scheduled', 'icon' => 'fa-calendar-check', 'where' => "$open_sql AND ticket_schedule IS NOT NULL", + // booked, not scheduled - a web application firewall takes a value starting sched for the Unix command + 'booked' => ['label' => 'Scheduled', 'icon' => 'fa-calendar-check', 'where' => "$open_sql AND ticket_schedule IS NOT NULL", 'title' => 'A visit or call is booked'], ]; // Mentioned me - open tickets with an internal note that @mentions you (functions/ticket_mention.php), after Mine @@ -231,6 +232,9 @@ $shows = projectTicketsShows($shows, $base_sql, $project_filter); // A status or billing filter asked for on its own looks at every ticket - unbilled work is nearly all done already $show = $_GET['show'] ?? ''; +if ($show === 'scheduled') { + $show = 'booked'; // its name from before +} if (!isset($shows[$show])) { $show = ($view === 'list' && !isset($_GET['show']) && ($status_filter || $billing_filter)) ? 'all' : 'open'; } diff --git a/client/post.php b/client/post.php index a232a4350..2a79e9e8a 100644 --- a/client/post.php +++ b/client/post.php @@ -1445,7 +1445,8 @@ if (isset($_GET['create_stripe_checkout'])) { $stripe_customer_id = $client_provider ? escapeSql($client_provider['payment_provider_client']) : null; // Return URL when checkout finishes - $return_url = "https://$config_base_url/client/post.php?stripe_save_card&session_id={CHECKOUT_SESSION_ID}"; + // checkout, not session_id: a web application firewall takes session_id with no Referer for session fixation + $return_url = "https://$config_base_url/client/post.php?stripe_save_card&checkout={CHECKOUT_SESSION_ID}"; try { require_once '../includes/stripe_init.php'; @@ -1531,7 +1532,7 @@ if (isset($_GET['stripe_save_card'])) { } // The checkout session from the address must be the one this sign-in started - $checkout_session_id = (string) ($_GET['session_id'] ?? ''); + $checkout_session_id = (string) ($_GET['checkout'] ?? $_GET['session_id'] ?? ''); $expected_session_id = (string) ($_SESSION['stripe_checkout_session_id'] ?? ''); unset($_SESSION['stripe_checkout_session_id']); if ($checkout_session_id === '' || $expected_session_id === '' || !hash_equals($expected_session_id, $checkout_session_id)) { diff --git a/functions/billing_pay.php b/functions/billing_pay.php index b37d6cd64..be4a3644e 100644 --- a/functions/billing_pay.php +++ b/functions/billing_pay.php @@ -821,7 +821,7 @@ function autopayCheckoutStart(array $invoice, $name, $email, &$error = '') { 'currency' => strtolower($offer['currency']), 'customer' => $customer, 'payment_method_types' => ['card'], - 'return_url' => "https://$config_base_url/guest/guest_post.php?guest_autopay_done=1&invoice_id=$invoice_id&url_key=" . rawurlencode((string) $invoice['invoice_url_key']) . '&session_id={CHECKOUT_SESSION_ID}', + 'return_url' => "https://$config_base_url/guest/guest_post.php?guest_autopay_done=1&invoice_id=$invoice_id&url_key=" . rawurlencode((string) $invoice['invoice_url_key']) . '&checkout={CHECKOUT_SESSION_ID}', // not session_id - see client/post.php 'metadata' => $ids + [ 'itflow_consent_name' => $name, 'itflow_consent_email' => $email, diff --git a/functions/card_expiry.php b/functions/card_expiry.php index 1006eb2f9..8d0a129be 100644 --- a/functions/card_expiry.php +++ b/functions/card_expiry.php @@ -305,7 +305,7 @@ function cardUpdateCheckoutStart(array $card, $name, $email, &$error = ''): stri 'currency' => strtolower($entry['recurring'][0]['currency'] ?: ($card['client_currency_code'] ?: 'usd')), 'customer' => $customer, 'payment_method_types' => ['card'], - 'return_url' => "https://$config_base_url/guest/guest_post.php?guest_card_update_done=1&card=$card_id&key=" . rawurlencode((string) $card['saved_payment_update_key']) . '&session_id={CHECKOUT_SESSION_ID}', + 'return_url' => "https://$config_base_url/guest/guest_post.php?guest_card_update_done=1&card=$card_id&key=" . rawurlencode((string) $card['saved_payment_update_key']) . '&checkout={CHECKOUT_SESSION_ID}', // not session_id - see client/post.php 'metadata' => $ids + [ 'itflow_consent_name' => $name, 'itflow_consent_email' => $email, diff --git a/guest/guest_post.php b/guest/guest_post.php index 8891ca64d..1d3a2e15e 100644 --- a/guest/guest_post.php +++ b/guest/guest_post.php @@ -1,5 +1,15 @@