$this->Authentication = true; } else { $this->Authentication = false; } } else { $this->Authentication = false; } } catch (Exception $e) { throw $e; } } /** This method validates if the timestamp is valid @access public @throws Exception object @return void */ public function validate_timestamp() { try { //Look for header timestamp if (!isset($this->Headers->{"X-Timestamp"}) || !is_numeric($this->Headers->{"X-Timestamp"})) { HttpHandler::header(400); } //Check if timestamp isn't expired $timediff = (int) (time() - $this->Headers->{"X-Timestamp"}); if ($timediff >= $this->Application->config("service->request_timeout")) { HttpHandler::header(408); } } catch (Exception $e) { throw $e; } } /** This method authenticate the user