Beispiel #1
0
 public function isAllowedApplication()
 {
     if (in_array("*", $this->proxyConfig['allowedreferers'])) {
         $this->referer = $_SERVER['SERVER_NAME'];
         //This is to enable browser testing when * is used
         $isAllowedApplication = true;
         return $isAllowedApplication;
     } else {
         $this->referer = $_SERVER['HTTP_REFERER'];
     }
     $isAllowedApplication = false;
     if (in_array($this->referer, $this->proxyConfig['allowedreferers'])) {
         $isAllowedApplication = true;
     } else {
         $this->proxyLog->log("Attempt made to use this proxy from " . $this->referer . " and " . $_SERVER['REMOTE_ADDR']);
     }
     return $isAllowedApplication;
 }
Beispiel #2
0
 public function isAllowedApplication()
 {
     //if allowedReferer = "" or "*" (if allowedReferer does not exist, it will be "")
     if (in_array("*", $this->proxyConfig['allowedreferers']) || in_array("", $this->proxyConfig['allowedreferers'])) {
         $this->referer = $_SERVER['SERVER_NAME'];
         //This is to enable browser testing when * is used
         $isAllowedApplication = true;
         return $isAllowedApplication;
     } else {
         $this->referer = $_SERVER['HTTP_REFERER'];
     }
     $isAllowedApplication = false;
     if ($this->checkAllowedReferer()) {
         $isAllowedApplication = true;
     } else {
         $message = "Attempt made to use this proxy from " . $this->referer . " and " . $_SERVER['REMOTE_ADDR'];
         $this->proxyLog->log($message);
     }
     return $isAllowedApplication;
 }