From cf76b167a3303fb6e81f1a571756cfa9640f2596 Mon Sep 17 00:00:00 2001 From: ThaMunsta Date: Fri, 31 May 2024 16:55:45 -0400 Subject: [PATCH] manual changes --- cron.php | 2 +- cron_domain_refresher.php | 2 +- cron_mail_queue.php | 2 +- cron_ticket_email_parser.php | 4 ++-- functions.php | 13 +++++++++---- post/setting.php | 2 +- 6 files changed, 15 insertions(+), 10 deletions(-) diff --git a/cron.php b/cron.php index 8ea474b9..ca64d611 100644 --- a/cron.php +++ b/cron.php @@ -81,7 +81,7 @@ if ($config_enable_cron == 0) { } // Check Cron Key -if ( $argv[1] !== $config_cron_key ) { +if ($argv[1] !== $config_cron_key && $_GET['key'] !== $config_cron_key) { exit("Cron Key invalid -- Quitting.."); } diff --git a/cron_domain_refresher.php b/cron_domain_refresher.php index 5a312bb6..83f8963b 100644 --- a/cron_domain_refresher.php +++ b/cron_domain_refresher.php @@ -24,7 +24,7 @@ if ($config_enable_cron == 0) { } // Check Cron Key -if ( $argv[1] !== $config_cron_key ) { +if ($argv[1] !== $config_cron_key && $_GET['key'] !== $config_cron_key) { exit("Cron Key invalid -- Quitting.."); } diff --git a/cron_mail_queue.php b/cron_mail_queue.php index f6fb6088..b19f3f67 100644 --- a/cron_mail_queue.php +++ b/cron_mail_queue.php @@ -28,7 +28,7 @@ if ($config_enable_cron == 0) { } // Check Cron Key -if ($argv[1] !== $config_cron_key) { +if ($argv[1] !== $config_cron_key && $_GET['key'] !== $config_cron_key) { exit("Cron Key invalid -- Quitting.."); } diff --git a/cron_ticket_email_parser.php b/cron_ticket_email_parser.php index a01281cb..7f19f36b 100644 --- a/cron_ticket_email_parser.php +++ b/cron_ticket_email_parser.php @@ -43,7 +43,7 @@ if ($config_ticket_email_parse == 0) { $argv = $_SERVER['argv']; // Check Cron Key -if ( $argv[1] !== $config_cron_key ) { +if ($argv[1] !== $config_cron_key && $_GET['key'] !== $config_cron_key) { exit("Cron Key invalid -- Quitting.."); } @@ -374,7 +374,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac // END ADD REPLY FUNCTION ------------------------------------------------- // Prepare connection string with encryption (TLS/SSL/) -$imap_mailbox = "$config_imap_host:$config_imap_port/imap/$config_imap_encryption"; +$imap_mailbox = "$config_imap_host:$config_imap_port/imap/novalidate-cert/$config_imap_encryption"; // Connect to host via IMAP $imap = imap_open("{{$imap_mailbox}}INBOX", $config_imap_username, $config_imap_password); diff --git a/functions.php b/functions.php index c7bd7204..12be4fb5 100644 --- a/functions.php +++ b/functions.php @@ -839,12 +839,17 @@ function roundToNearest15($time) // Convert everything to seconds for easier calculation $totalSeconds = ($hours * 3600) + ($minutes * 60) + $seconds; + + // Minimum half hour + if ($totalSeconds < 1800) { + $totalSeconds = 1800; + } - // Calculate the remainder when divided by 900 seconds (15 minutes) - $remainder = $totalSeconds % 900; + // Calculate the remainder when divided by 1800 seconds (30 minutes) + $remainder = $totalSeconds % 1800; - if ($remainder > 450) { // If remainder is more than 7.5 minutes (450 seconds), round up - $totalSeconds += (900 - $remainder); + if ($remainder > 900) { // If remainder is more than 15 minutes (900 seconds), round up + $totalSeconds += (1800 - $remainder); } else { // Else round down $totalSeconds -= $remainder; } diff --git a/post/setting.php b/post/setting.php index b78bcebf..7dc85d9d 100644 --- a/post/setting.php +++ b/post/setting.php @@ -199,7 +199,7 @@ if (isset($_POST['test_email_imap'])) { validateAdminRole(); // Prepare connection string with encryption (TLS/SSL/) - $imap_mailbox = "$config_imap_host:$config_imap_port/imap/readonly/$config_imap_encryption"; + $imap_mailbox = "$config_imap_host:$config_imap_port/imap/novalidate-cert/readonly/$config_imap_encryption"; // Connect $imap = imap_open("{{$imap_mailbox}}INBOX", $config_imap_username, $config_imap_password);