public function __construct($request, $origin) { parent::__construct($request); $file = CONFIG_PATH . join('', array_slice(explode('\\', __CLASS__), -1)) . '.config.php'; parent::$_config = (require $file); $this->session = new Models\Session(); }
public function __construct($request, $origin) { parent::__construct($request); $file = CONFIG_PATH . join('', array_slice(explode('\\', __CLASS__), -1)) . '.config.php'; parent::$_config = (require $file); $box = new Models\Box(); if (false && $apiKeyEvaluation) { // Prevent CSRF attacks evaluating if apiKey is active for $origin $APIKey = new Models\APIKey(); if (!array_key_exists('apiKey', $this->request)) { // if API version lacks throw new \Exception('No API Key provided'); } else { if (!$APIKey->verifyKey($this->request['apiKey'], $origin)) { // if API version is not valid for the origin throw new \Exception('Invalid API Key'); } } } }