From fa56b1ccb81df7e966ccec3c76c5cda40d94bb6e Mon Sep 17 00:00:00 2001 From: David Goodwin Date: Sat, 1 Jun 2024 08:57:57 +0100 Subject: [PATCH] scripts/examples/vacation-cron.php: add db_get_boolean() call, this should let it work on postgresql too --- scripts/examples/vacation-cron.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/examples/vacation-cron.php b/scripts/examples/vacation-cron.php index 175eaa3a..5a63825a 100644 --- a/scripts/examples/vacation-cron.php +++ b/scripts/examples/vacation-cron.php @@ -21,7 +21,10 @@ require_once(__DIR__ . '/../../public/common.php'); define('POSTFIXADMIN_CLI', 1); $table_vacation = table_by_key('vacation'); -$vacations_that_need_deactivating = db_query_all("SELECT * FROM $table_vacation WHERE activeuntil <= NOW() AND active = 1 "); + +$active = db_get_boolean(1); + +$vacations_that_need_deactivating = db_query_all("SELECT * FROM $table_vacation WHERE activeuntil <= NOW() AND active = :active ", ['active' => $active]); foreach ($vacations_that_need_deactivating as $row) {