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

This commit is contained in:
johnnyq 2025-10-08 01:00:48 -04:00
parent 35a7506c26
commit 2ec4cdc4fb
10 changed files with 72 additions and 107 deletions

View File

@ -3,6 +3,7 @@
This file documents all notable changes made to ITFlow. This file documents all notable changes made to ITFlow.
## [25.10.1] ## [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 ### Fixes
- Fix regression missing custom Favicon. - Fix regression missing custom Favicon.
@ -14,11 +15,14 @@ This file documents all notable changes made to ITFlow.
- Prevent open redirects upon agent login. - Prevent open redirects upon agent login.
- Fix regression on switching to Webklex IMAP to allow for no SSL/TLS in IMAP. - 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. - 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 ### Added / Changed
- Support for HTML Signatures. - Support for HTML Signatures.
- Add Edit Project Functionality in a ticket. - 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] ## [25.10]

View File

@ -1,6 +1,6 @@
<?php <?php
require_once 'includes/guest_header.php'; require_once 'includes/inc_all_guest.php';
DEFINE("WORDING_PAYMENT_FAILED", "<br><h2>There was an error verifying your payment. Please contact us for more information before attempting payment again.</h2>"); DEFINE("WORDING_PAYMENT_FAILED", "<br><h2>There was an error verifying your payment. Please contact us for more information before attempting payment again.</h2>");
@ -300,4 +300,4 @@ if (isset($_GET['invoice_id'], $_GET['url_key']) && !isset($_GET['payment_intent
exit(WORDING_PAYMENT_FAILED); exit(WORDING_PAYMENT_FAILED);
} }
require_once 'includes/guest_footer.php'; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';

View File

@ -1,10 +1,10 @@
<?php <?php
require_once "includes/guest_header.php"; require_once "includes/inc_all_guest.php";
if (!isset($_GET['invoice_id'], $_GET['url_key'])) { if (!isset($_GET['invoice_id'], $_GET['url_key'])) {
echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>"; echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -25,7 +25,7 @@ $sql = mysqli_query(
if (mysqli_num_rows($sql) !== 1) { if (mysqli_num_rows($sql) !== 1) {
// Invalid invoice/key // Invalid invoice/key
echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>"; echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -478,4 +478,4 @@ if ($outstanding_invoices_count > 0) { ?>
<?php } // End previous unpaid invoices <?php } // End previous unpaid invoices
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';

View File

@ -4,7 +4,7 @@ header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false); header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache'); header('Pragma: no-cache');
require_once "includes/guest_header.php"; require_once "includes/inc_all_guest.php";
//Initialize the HTML Purifier to prevent XSS //Initialize the HTML Purifier to prevent XSS
@ -39,7 +39,7 @@ $currency_format = numfmt_create($company_locale, NumberFormatter::CURRENCY);
<?php <?php
if (!isset($_GET['id']) || !isset($_GET['key'])) { if (!isset($_GET['id']) || !isset($_GET['key'])) {
echo "<div class='alert alert-danger'>Incorrect URL.</div>"; echo "<div class='alert alert-danger'>Incorrect URL.</div>";
include "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -53,7 +53,7 @@ $row = mysqli_fetch_array($sql);
// Check we got a result // Check we got a result
if (mysqli_num_rows($sql) !== 1 || !$row) { if (mysqli_num_rows($sql) !== 1 || !$row) {
echo "<div class='alert alert-danger' >No item to view. Check with the person that sent you this link to ensure it is correct and has not expired.</div>"; echo "<div class='alert alert-danger' >No item to view. Check with the person that sent you this link to ensure it is correct and has not expired.</div>";
include "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); 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 // 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'])) { if ($row['item_active'] !== "1" || ($row['item_view_limit'] > 0 && $row['item_views'] >= $row['item_view_limit'])) {
echo "<div class='alert alert-danger'>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.</div>"; echo "<div class='alert alert-danger'>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.</div>";
include "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -123,7 +123,7 @@ if ($item_type == "Document") {
if (mysqli_num_rows($doc_sql) !== 1 || !$doc_row) { if (mysqli_num_rows($doc_sql) !== 1 || !$doc_row) {
echo "<div class='alert alert-danger'>Error retrieving document to view.</div>"; echo "<div class='alert alert-danger'>Error retrieving document to view.</div>";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -150,7 +150,7 @@ if ($item_type == "Document") {
if (mysqli_num_rows($file_sql) !== 1 || !$file_row) { if (mysqli_num_rows($file_sql) !== 1 || !$file_row) {
echo "<div class='alert alert-danger'>Error retrieving file.</div>"; echo "<div class='alert alert-danger'>Error retrieving file.</div>";
include "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -171,7 +171,7 @@ if ($item_type == "Document") {
$credential_row = mysqli_fetch_array($credential_sql); $credential_row = mysqli_fetch_array($credential_sql);
if (mysqli_num_rows($credential_sql) !== 1 || !$credential_row) { if (mysqli_num_rows($credential_sql) !== 1 || !$credential_row) {
echo "<div class='alert alert-danger'>Error retrieving login.</div>"; echo "<div class='alert alert-danger'>Error retrieving login.</div>";
include "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -274,6 +274,4 @@ if ($item_type == "Document") {
</div> </div>
<?php <?php
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
?>

View File

@ -1,11 +1,11 @@
<?php <?php
require_once "includes/guest_header.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/guest/includes/inc_all_guest.php';
if (!isset($_GET['quote_id'], $_GET['url_key'])) { if (!isset($_GET['quote_id'], $_GET['url_key'])) {
echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>"; echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -27,7 +27,7 @@ $sql = mysqli_query(
if (mysqli_num_rows($sql) !== 1) { if (mysqli_num_rows($sql) !== 1) {
// Invalid quote/key // Invalid quote/key
echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>"; echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -133,7 +133,7 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
<div class="row mb-3"> <div class="row mb-3">
<?php if (file_exists("../uploads/settings/$company_logo")) { ?> <?php if (file_exists("../uploads/settings/$company_logo")) { ?>
<div class="col-sm-2"> <div class="col-sm-2">
<img class="img-fluid" src="<?php echo "../uploads/settings/$company_logo"; ?>" alt="Company logo"> <img class="img-fluid" src="<?php echo "/uploads/settings/$company_logo"; ?>" alt="Company logo">
</div> </div>
<?php } ?> <?php } ?>
<div class="col-sm-6 <?php if (!file_exists("../uploads/settings/$company_logo")) { echo "col-sm-8"; } ?>"> <div class="col-sm-6 <?php if (!file_exists("../uploads/settings/$company_logo")) { echo "col-sm-8"; } ?>">
@ -301,4 +301,4 @@ if ($quote_status == "Draft" || $quote_status == "Sent" || $quote_status == "Vie
<?php <?php
require_once "guest_quote_upload_file_modal.php"; require_once "guest_quote_upload_file_modal.php";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';

View File

@ -1,6 +1,6 @@
<?php <?php
require_once "includes/guest_header.php"; require_once "includes/inc_all_guest.php";
//Initialize the HTML Purifier to prevent XSS //Initialize the HTML Purifier to prevent XSS
require "../plugins/htmlpurifier/HTMLPurifier.standalone.php"; require "../plugins/htmlpurifier/HTMLPurifier.standalone.php";
@ -12,7 +12,7 @@ $purifier = new HTMLPurifier($purifier_config);
if (!isset($_GET['ticket_id'], $_GET['url_key'])) { if (!isset($_GET['ticket_id'], $_GET['url_key'])) {
echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>"; echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -47,7 +47,7 @@ $ticket_sql = mysqli_query($mysqli,
if (mysqli_num_rows($ticket_sql) !== 1) { if (mysqli_num_rows($ticket_sql) !== 1) {
// Invalid invoice/key // Invalid invoice/key
echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>"; echo "<br><h2>Oops, something went wrong! Please raise a ticket if you believe this is an error.</h2>";
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';
exit(); exit();
} }
@ -210,7 +210,7 @@ if ($ticket_row) {
?> ?>
<script src="../js/pretty_content.js"></script> <script src="/js/pretty_content.js"></script>
<?php } else { <?php } else {
echo "Ticket ID not found!"; echo "Ticket ID not found!";
@ -221,4 +221,4 @@ if ($ticket_row) {
</div> </div>
<?php <?php
require_once "includes/guest_footer.php"; require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/footer.php';

View File

@ -1,29 +0,0 @@
</div><!-- /.container-fluid -->
</div>
<!-- /.content -->
</div>
<!-- /.content-wrapper -->
</div>
<!-- ./wrapper -->
<!-- REQUIRED SCRIPTS -->
<?php require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/inc_confirm_modal.php'; ?>
<!-- jQuery -->
<script src="/plugins/jquery/jquery.min.js"></script>
<!-- Bootstrap 4 -->
<script src="/plugins/bootstrap/js/bootstrap.bundle.min.js"></script>
<!-- AdminLTE App -->
<script src="/plugins/adminlte/js/adminlte.min.js"></script>
<!-- Custom js -->
<script src="/plugins/tempusdominus-bootstrap-4/js/tempusdominus-bootstrap-4.min.js"></script>
<script src="/plugins/moment/moment.min.js"></script>
<script src='/plugins/daterangepicker/daterangepicker.js'></script>
<script src='/plugins/select2/js/select2.min.js'></script>
<script src='/plugins/inputmask/inputmask.min.js'></script>
<script src="/js/app.js"></script>
<script src="/js/pretty_content.js"></script>
<script src="/js/confirm_modal.js"></script>
</body>
</html>

View File

@ -1,27 +1,3 @@
<?php
require_once $_SERVER['DOCUMENT_ROOT'] . '/config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/load_global_settings.php';
session_start();
// Set Timezone
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/inc_set_timezone.php';
$ip = sanitizeInput(getIP());
$user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
$os = sanitizeInput(getOS($user_agent));
$browser = sanitizeInput(getWebBrowser($user_agent));
// Get Company Name
$sql = mysqli_query($mysqli, "SELECT company_name FROM companies WHERE company_id = 1");
$row = mysqli_fetch_array($sql);
$session_company_name = $row['company_name'];
?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en"> <html lang="en">
<head> <head>
@ -51,32 +27,10 @@ $session_company_name = $row['company_name'];
<link rel="stylesheet" href="/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css"> <link rel="stylesheet" href="/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css">
<link rel="stylesheet" href='/plugins/daterangepicker/daterangepicker.css'> <link rel="stylesheet" href='/plugins/daterangepicker/daterangepicker.css'>
<!-- Scripts -->
<script src="/plugins/jquery/jquery.min.js"></script>
<script src="/plugins/toastr/toastr.min.js"></script>
</head> </head>
<body class="layout-top-nav"> <body class="layout-top-nav">
<div class="wrapper text-sm"> <div class="wrapper text-sm">
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<div class="content">
<div class="container">
<?php
//Alert Feedback
if (!empty($_SESSION['alert_message'])) {
if (!isset($_SESSION['alert_type'])) {
$_SESSION['alert_type'] = "info";
}
?>
<div class="alert alert-<?php echo $_SESSION['alert_type']; ?>" id="alert">
<?php echo nullable_htmlentities($_SESSION['alert_message']); ?>
<button class='close' data-dismiss='alert'>&times;</button>
</div>
<?php
unset($_SESSION['alert_type']);
unset($_SESSION['alert_message']);
}
?>

View File

@ -0,0 +1,32 @@
<?php
// Configuration & core
require_once $_SERVER['DOCUMENT_ROOT'] . '/config.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/functions.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/load_global_settings.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/session_init.php';
// Set Timezone
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/inc_set_timezone.php';
$ip = sanitizeInput(getIP());
$user_agent = sanitizeInput($_SERVER['HTTP_USER_AGENT']);
$os = sanitizeInput(getOS($user_agent));
$browser = sanitizeInput(getWebBrowser($user_agent));
// Get Company Name
$sql = mysqli_query($mysqli, "SELECT company_name FROM companies WHERE company_id = 1");
$row = mysqli_fetch_array($sql);
$session_company_name = $row['company_name'];
// Page setup
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/page_title.php';
// Layout UI
require_once $_SERVER['DOCUMENT_ROOT'] . '/guest/includes/guest_header.php';
// Wrapper & alerts
require_once $_SERVER['DOCUMENT_ROOT'] . '/guest/includes/inc_wrapper.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/inc_alert_feedback.php';
//require_once $_SERVER['DOCUMENT_ROOT'] . '/includes/filter_header.php';

View File

@ -0,0 +1,6 @@
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper">
<!-- Main content -->
<div class="content">
<div class="container">