Пример #1
0
 public function AssertURL($http_response_code = 301, $currentOnly = true)
 {
     if (!$currentOnly || get_class($this) == utopia::GetCurrentModule()) {
         $url = $this->GetURL($_GET);
         $checkurl = $_SERVER['REQUEST_URI'];
         if ($this->isSecurePage && !utopia::IsRequestSecure() || $checkurl !== $url) {
             $abs = '';
             if ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') != $this->isSecurePage) {
                 $layer = 'http';
                 if ($this->isSecurePage) {
                     $layer .= 's';
                 }
                 $abs = $layer . '://' . utopia::GetDomainName();
             }
             header('Cache-Control: no-store, no-cache, must-revalidate');
             // don't cache redirects
             header('Location: ' . $abs . $url, true, $http_response_code);
             die;
         }
     }
 }