From 49cd94f55c3570dff93f758bdacb2396c04a4310 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 13 Jul 2015 18:50:28 +0200 Subject: [PATCH] Fixed automatic revocation of paid subscriptions --- .../system/cronjob/HourlyCleanUpCronjob.class.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/wcfsetup/install/files/lib/system/cronjob/HourlyCleanUpCronjob.class.php b/wcfsetup/install/files/lib/system/cronjob/HourlyCleanUpCronjob.class.php index c502088b4e..d510170199 100644 --- a/wcfsetup/install/files/lib/system/cronjob/HourlyCleanUpCronjob.class.php +++ b/wcfsetup/install/files/lib/system/cronjob/HourlyCleanUpCronjob.class.php @@ -23,13 +23,14 @@ class HourlyCleanUpCronjob extends AbstractCronjob { // disable expired paid subscriptions if (MODULE_PAID_SUBSCRIPTION) { - $subscriptionUser = new PaidSubscriptionUserList(); - $subscriptionUser->getConditionBuilder()->add('isActive = ?', array(1)); - $subscriptionUser->getConditionBuilder()->add('endDate > 0 AND endDate < ?', array(TIME_NOW)); - $subscriptionUser->readObjects(); + $subscriptionUserList = new PaidSubscriptionUserList(); + $subscriptionUserList->getConditionBuilder()->add('isActive = ?', array(1)); + $subscriptionUserList->getConditionBuilder()->add('endDate > 0 AND endDate < ?', array(TIME_NOW)); + $subscriptionUserList->readObjects(); - if (count($subscriptionUser->getObjects())) { - $action = new PaidSubscriptionUserAction(array($subscriptionUser->getObjects()), 'revoke'); + if (count($subscriptionUserList->getObjects())) { + $action = new PaidSubscriptionUserAction($subscriptionUserList->getObjects(), 'revoke'); + $action->executeAction(); } } } -- 2.20.1