From 679edd0b8c8816b856e17a850d5a30a492fe9f3c Mon Sep 17 00:00:00 2001 From: Waldo Jaquith Date: Sun, 7 Jan 2024 22:36:32 -0500 Subject: [PATCH] Expand on IN_SESSION IN_SESSION was covering both "the legislature has convened" and "legislative stuff is happening." Breaking it out into IN_SESSION and LEGISLATIVE_SEASON means that we can be finer-grained about which functions run when. --- cron/checks.php | 2 +- cron/cleanup.php | 2 +- cron/copatrons-manual.php | 2 +- cron/ps_send_emails.php | 5 ++++- cron/update.php | 2 +- cron/vote.php | 2 +- 6 files changed, 9 insertions(+), 6 deletions(-) diff --git a/cron/checks.php b/cron/checks.php index a1141c9..6984fe9 100644 --- a/cron/checks.php +++ b/cron/checks.php @@ -8,7 +8,7 @@ * @usage Must be invoked from within update.php. */ - if (IN_SESSION == 'Y') + if (LEGISLATIVE_SEASON == true) { /* diff --git a/cron/cleanup.php b/cron/cleanup.php index c62584b..ec80083 100644 --- a/cron/cleanup.php +++ b/cron/cleanup.php @@ -644,7 +644,7 @@ # it's not in session, we based it on the past three days. The formula itself is based on five # factors: comments, views, Photosynthesis adds, poll votes, and subscriptions to comments. ### -if (IN_SESSION == 'y') +if (LEGISLATIVE_SEASON == true) { $days = 1; } diff --git a/cron/copatrons-manual.php b/cron/copatrons-manual.php index ce46a02..71490b1 100644 --- a/cron/copatrons-manual.php +++ b/cron/copatrons-manual.php @@ -15,7 +15,7 @@ include_once(__DIR__ . '/../includes/settings.inc.php'); include_once(__DIR__ . '/../includes/functions.inc.php'); -if (IN_SESSION == 'N') +if (LEGISLATIVE_SEASON == false) { die('The General Assembly is not in session.'); } diff --git a/cron/ps_send_emails.php b/cron/ps_send_emails.php index dedb5dc..8376122 100644 --- a/cron/ps_send_emails.php +++ b/cron/ps_send_emails.php @@ -23,7 +23,10 @@ require_once __DIR__ . '/../includes/phpmailer/class.phpmailer.php'; # Don't bother to run this if the General Assembly isn't in session. - if (IN_SESSION == 'n') exit(); + if (LEGISLATIVE_SEASON == false) + { + exit(); + } # DECLARATIVE FUNCTIONS # Run those functions that are necessary prior to loading this specific diff --git a/cron/update.php b/cron/update.php index a6908a3..0c35e54 100644 --- a/cron/update.php +++ b/cron/update.php @@ -33,7 +33,7 @@ $log = new Log; # Don't bother to run this if the General Assembly isn't in session. -if (IN_SESSION == 'N') +if (LEGISLATIVE_SEASON == false) { exit(); } diff --git a/cron/vote.php b/cron/vote.php index 2f07fdb..e4929a5 100644 --- a/cron/vote.php +++ b/cron/vote.php @@ -7,7 +7,7 @@ */ # Don't bother to run this if the General Assembly isn't in session. -if (IN_SESSION == 'n') +if (IN_SESSION == false) { return FALSE; }