Beispiel #1
0
 public function getAllSiteUrls()
 {
     $model = new Model();
     $siteIds = $model->getSitesId();
     $siteUrls = array();
     if (empty($siteIds)) {
         return array();
     }
     foreach ($siteIds as $siteId) {
         $siteId = (int) $siteId;
         $siteUrls[$siteId] = $model->getSiteUrlsFromId($siteId);
     }
     return $siteUrls;
 }
Beispiel #2
0
 private function performRedirectToUrlIfSet()
 {
     if (!$this->hasRedirectUrl()) {
         return;
     }
     if (empty($this->requests)) {
         return;
     }
     $redirectUrl = $this->getRedirectUrl();
     $host = Url::getHostFromUrl($redirectUrl);
     if (empty($host)) {
         return;
     }
     $siteIds = array();
     foreach ($this->requests as $request) {
         $siteIds[] = (int) $request['idsite'];
     }
     $siteIds = array_unique($siteIds);
     $model = new Model();
     foreach ($siteIds as $siteId) {
         $siteUrls = $model->getSiteUrlsFromId($siteId);
         if (Url::isHostInUrls($host, $siteUrls)) {
             Url::redirectToUrl($redirectUrl);
         }
     }
 }