Non-activated users no longer can purchase paid subscriptions
authorMarcel Werk <burntime@woltlab.com>
Fri, 5 May 2017 15:21:40 +0000 (17:21 +0200)
committerMarcel Werk <burntime@woltlab.com>
Fri, 5 May 2017 15:21:40 +0000 (17:21 +0200)
wcfsetup/install/files/lib/page/PaidSubscriptionListPage.class.php

index a7e5d54a8f8f782ddceb69ffdf53d2bf4796059a..6eb98492692880d3cceba3ab30a1462ebd79f40b 100644 (file)
@@ -2,6 +2,7 @@
 namespace wcf\page;
 use wcf\data\paid\subscription\user\PaidSubscriptionUserList;
 use wcf\system\cache\builder\PaidSubscriptionCacheBuilder;
+use wcf\system\exception\PermissionDeniedException;
 use wcf\system\menu\user\UserMenu;
 use wcf\system\WCF;
 
@@ -38,6 +39,17 @@ class PaidSubscriptionListPage extends AbstractPage {
         */
        public $userSubscriptionList = array();
        
+       /**
+        * @see \wcf\page\AbstractPage::checkPermissions()
+        */
+       public function checkPermissions() {
+               parent::checkPermissions();
+               
+               if (WCF::getUser()->activationCode != 0) {
+                       throw new PermissionDeniedException();
+               }
+       }
+       
        /**
         * @see \wcf\page\AbstractPage::readData()
         */