Example #1
0
 /**
  * @param \Cms\Access\Auth\Result|null $authResult
  *
  * @throws \Cms\Exception
  */
 protected function checkIfSpaceIsExpired($authResult)
 {
     $quota = new \Cms\Quota();
     if (!$quota->isSpaceExpired()) {
         return;
     }
     $exceptionData = array();
     if ($authResult instanceof \Cms\Access\Auth\Result) {
         $identity = $authResult->getIdentity();
         if (isset($identity['owner']) && $identity['owner'] == true) {
             $cfg = Registry::getConfig();
             if (isset($cfg->owner) && isset($cfg->owner->dashboardUrl)) {
                 $exceptionData['redirect'] = $cfg->owner->dashboardUrl;
             }
         }
     }
     throw new \Cms\Exception(9, __METHOD__, __LINE__, $exceptionData);
 }