manual changes

This commit is contained in:
ThaMunsta
2024-05-31 16:55:45 -04:00
parent 5f0c363503
commit cf76b167a3
6 changed files with 15 additions and 10 deletions
+1 -1
View File
@@ -81,7 +81,7 @@ if ($config_enable_cron == 0) {
} }
// Check Cron Key // 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.."); exit("Cron Key invalid -- Quitting..");
} }
+1 -1
View File
@@ -24,7 +24,7 @@ if ($config_enable_cron == 0) {
} }
// Check Cron Key // 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.."); exit("Cron Key invalid -- Quitting..");
} }
+1 -1
View File
@@ -28,7 +28,7 @@ if ($config_enable_cron == 0) {
} }
// Check Cron Key // 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.."); exit("Cron Key invalid -- Quitting..");
} }
+2 -2
View File
@@ -43,7 +43,7 @@ if ($config_ticket_email_parse == 0) {
$argv = $_SERVER['argv']; $argv = $_SERVER['argv'];
// Check Cron Key // 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.."); exit("Cron Key invalid -- Quitting..");
} }
@@ -374,7 +374,7 @@ function addReply($from_email, $date, $subject, $ticket_number, $message, $attac
// END ADD REPLY FUNCTION ------------------------------------------------- // END ADD REPLY FUNCTION -------------------------------------------------
// Prepare connection string with encryption (TLS/SSL/<blank>) // Prepare connection string with encryption (TLS/SSL/<blank>)
$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 // Connect to host via IMAP
$imap = imap_open("{{$imap_mailbox}}INBOX", $config_imap_username, $config_imap_password); $imap = imap_open("{{$imap_mailbox}}INBOX", $config_imap_username, $config_imap_password);
+9 -4
View File
@@ -840,11 +840,16 @@ function roundToNearest15($time)
// Convert everything to seconds for easier calculation // Convert everything to seconds for easier calculation
$totalSeconds = ($hours * 3600) + ($minutes * 60) + $seconds; $totalSeconds = ($hours * 3600) + ($minutes * 60) + $seconds;
// Calculate the remainder when divided by 900 seconds (15 minutes) // Minimum half hour
$remainder = $totalSeconds % 900; if ($totalSeconds < 1800) {
$totalSeconds = 1800;
}
if ($remainder > 450) { // If remainder is more than 7.5 minutes (450 seconds), round up // Calculate the remainder when divided by 1800 seconds (30 minutes)
$totalSeconds += (900 - $remainder); $remainder = $totalSeconds % 1800;
if ($remainder > 900) { // If remainder is more than 15 minutes (900 seconds), round up
$totalSeconds += (1800 - $remainder);
} else { // Else round down } else { // Else round down
$totalSeconds -= $remainder; $totalSeconds -= $remainder;
} }
+1 -1
View File
@@ -199,7 +199,7 @@ if (isset($_POST['test_email_imap'])) {
validateAdminRole(); validateAdminRole();
// Prepare connection string with encryption (TLS/SSL/<blank>) // Prepare connection string with encryption (TLS/SSL/<blank>)
$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 // Connect
$imap = imap_open("{{$imap_mailbox}}INBOX", $config_imap_username, $config_imap_password); $imap = imap_open("{{$imap_mailbox}}INBOX", $config_imap_username, $config_imap_password);