PABX da Simples IP
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

23 lines
643 B

<?php
namespace app\traits;
use app\shared\Logger;
use Exception;
trait MeetRequest
{
public function serverRequest()
{
$logger = new Logger('api' . date('Ymd'), true);
$logger->debug('meet request. HTTP_ORIGIN: ' . $_SERVER['HTTP_ORIGIN'], true);
// must be localhost
if (
!isset($_SERVER['HTTP_ORIGIN']) &&
(strpos($_SERVER['HTTP_ORIGIN'], 'localhost') === false || strpos($_SERVER['HTTP_ORIGIN'], '127.0.0.1') === false)
) {
$logger->debug('HTTP_ORIGIN is not set ', true);
//throw new Exception('Request nao permitida!');
}
}
}