Fixed automatic revocation of paid subscriptions
authorMarcel Werk <burntime@woltlab.com>
Mon, 13 Jul 2015 16:50:28 +0000 (18:50 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 13 Jul 2015 16:50:28 +0000 (18:50 +0200)
wcfsetup/install/files/lib/system/cronjob/HourlyCleanUpCronjob.class.php

index c502088b4e1d55af4e78bf2c33b40b0edc28bee7..d510170199777b43a0bda6a085b98126882691ec 100644 (file)
@@ -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();
                        }
                }
        }