From 2ec4cdc4fb9163bed958bab7fe5bfd9859ea2997 Mon Sep 17 00:00:00 2001 From: johnnyq Date: Wed, 8 Oct 2025 01:00:48 -0400 Subject: [PATCH] Ceated inc_all_guest.php and modulaized the guest header.php removed guest footer and used the global footer.php as they were very similar --- CHANGELOG.md | 6 +++- guest/guest_pay_invoice_stripe.php | 4 +-- guest/guest_view_invoice.php | 8 ++--- guest/guest_view_item.php | 18 +++++----- guest/guest_view_quote.php | 10 +++--- guest/guest_view_ticket.php | 10 +++--- guest/includes/guest_footer.php | 29 ---------------- guest/includes/guest_header.php | 56 +++--------------------------- guest/includes/inc_all_guest.php | 32 +++++++++++++++++ guest/includes/inc_wrapper.php | 6 ++++ 10 files changed, 72 insertions(+), 107 deletions(-) delete mode 100644 guest/includes/guest_footer.php create mode 100644 guest/includes/inc_all_guest.php create mode 100644 guest/includes/inc_wrapper.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c3b4f25c..75df39d7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ This file documents all notable changes made to ITFlow. ## [25.10.1] +- Deprecation Notice: `/scripts/cron_mail_queue.php` , `/scripts/cron_ticket_email_parser.php` , `/scripts/cron.php` `/scripts/cron_domain_refresher.php`, `/scripts/cron_certificate_refresher.php` are being phased out. Please transition to `/cron/mail_queue.php` , `/cron/ticket_email_parser.php`, `/cron/cron.php`, `/cron/domain_refresher.php`, `/cron/certificate_refresher.php` These older scripts will be removed in the November 25.11 release—update accordingly. 25.10.1 installs have the script already configured. ### Fixes - Fix regression missing custom Favicon. @@ -14,11 +15,14 @@ This file documents all notable changes made to ITFlow. - Prevent open redirects upon agent login. - Fix regression on switching to Webklex IMAP to allow for no SSL/TLS in IMAP. - Fix Setup Redirect not behaving properly when setup hasnt been performed. +- Added Server Document Root Var to several includes, headers, footers files to allow includes from deeper directory strutures such as the new custom directories. ### Added / Changed - Support for HTML Signatures. - Add Edit Project Functionality in a ticket. - +- Added more custom locations: /cron/custom/, /scripts/custom/, /api/v1/custom/, /setup/custom/. +- Copied `/scripts/cron.php` `/scripts/cron_domain_refresher.php`, `/scripts/cron_certificate_refresher.php` to `/cron/cron.php`, `/cron/domain_refresher.php`, `/cron/certificate_refresher.php`. See Above! +- ## [25.10] diff --git a/guest/guest_pay_invoice_stripe.php b/guest/guest_pay_invoice_stripe.php index 21526022..894c133a 100644 --- a/guest/guest_pay_invoice_stripe.php +++ b/guest/guest_pay_invoice_stripe.php @@ -1,6 +1,6 @@

There was an error verifying your payment. Please contact us for more information before attempting payment again.

"); @@ -300,4 +300,4 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent exit(WORDING_PAYMENT_FAILED); } -require_once 'includes/guest_footer.php'; +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; diff --git a/guest/guest_view_invoice.php b/guest/guest_view_invoice.php index 4e1ed287..35f98438 100644 --- a/guest/guest_view_invoice.php +++ b/guest/guest_view_invoice.php @@ -1,10 +1,10 @@

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; - require_once "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -25,7 +25,7 @@ $sql = mysqli_query( if (mysqli_num_rows($sql) !== 1) { // Invalid invoice/key echo "

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; - require_once "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -478,4 +478,4 @@ if ($outstanding_invoices_count > 0) { ?> Incorrect URL."; - include "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -53,7 +53,7 @@ $row = mysqli_fetch_array($sql); // Check we got a result if (mysqli_num_rows($sql) !== 1 || !$row) { echo "
No item to view. Check with the person that sent you this link to ensure it is correct and has not expired.
"; - include "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -61,7 +61,7 @@ if (mysqli_num_rows($sql) !== 1 || !$row) { // Check item share is active & hasn't been viewed too many times but allow 0 views as that is consider infinite views if ($row['item_active'] !== "1" || ($row['item_view_limit'] > 0 && $row['item_views'] >= $row['item_view_limit'])) { echo "
Item cannot be viewed at this time. Check with the person that sent you this link to ensure it is correct and has not expired.
"; - include "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -123,7 +123,7 @@ if ($item_type == "Document") { if (mysqli_num_rows($doc_sql) !== 1 || !$doc_row) { echo "
Error retrieving document to view.
"; - require_once "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -150,7 +150,7 @@ if ($item_type == "Document") { if (mysqli_num_rows($file_sql) !== 1 || !$file_row) { echo "
Error retrieving file.
"; - include "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -171,7 +171,7 @@ if ($item_type == "Document") { $credential_row = mysqli_fetch_array($credential_sql); if (mysqli_num_rows($credential_sql) !== 1 || !$credential_row) { echo "
Error retrieving login.
"; - include "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -274,6 +274,4 @@ if ($item_type == "Document") { +require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; diff --git a/guest/guest_view_quote.php b/guest/guest_view_quote.php index 7497f654..c791487d 100644 --- a/guest/guest_view_quote.php +++ b/guest/guest_view_quote.php @@ -1,11 +1,11 @@

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; - require_once "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -27,7 +27,7 @@ $sql = mysqli_query( if (mysqli_num_rows($sql) !== 1) { // Invalid quote/key echo "

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; - require_once "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -133,7 +133,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
- " alt="Company logo"> + " alt="Company logo">
"> @@ -301,4 +301,4 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; - require_once "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -47,7 +47,7 @@ $ticket_sql = mysqli_query($mysqli, if (mysqli_num_rows($ticket_sql) !== 1) { // Invalid invoice/key echo "

Oops, something went wrong! Please raise a ticket if you believe this is an error.

"; - require_once "includes/guest_footer.php"; + require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php'; exit(); } @@ -210,7 +210,7 @@ if ($ticket_row) { ?> - + -
- -
- - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/guest/includes/guest_header.php b/guest/includes/guest_header.php index e1d907a3..c45cdac3 100644 --- a/guest/includes/guest_header.php +++ b/guest/includes/guest_header.php @@ -1,27 +1,3 @@ - - @@ -51,32 +27,10 @@ $session_company_name = $row['company_name']; + + + + -
- - -
- - -
-
- - -
- - -
- +
\ No newline at end of file diff --git a/guest/includes/inc_all_guest.php b/guest/includes/inc_all_guest.php new file mode 100644 index 00000000..b30592a3 --- /dev/null +++ b/guest/includes/inc_all_guest.php @@ -0,0 +1,32 @@ + +
+ + +
+
\ No newline at end of file