0
0
mirror of https://github.com/postfixadmin/postfixadmin.git synced 2024-09-19 11:12:15 +02:00

scripts/examples/vacation-cron.php: add db_get_boolean() call, this should let it work on postgresql too

This commit is contained in:
David Goodwin 2024-06-01 08:57:57 +01:00
parent 06a7bb7fb6
commit fa56b1ccb8
No known key found for this signature in database

View File

@ -21,7 +21,10 @@ require_once(__DIR__ . '/../../public/common.php');
define('POSTFIXADMIN_CLI', 1); define('POSTFIXADMIN_CLI', 1);
$table_vacation = table_by_key('vacation'); $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) { foreach ($vacations_that_need_deactivating as $row) {