requestGetClose.php 621 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. require_once('request.php');
  3. class arkiwiRequestGetClose extends arkiwiRequest
  4. {
  5. private $sId = null;
  6. public function __construct($ak) {
  7. parent::__construct($ak);
  8. $extra = $this->getRequestExtra();
  9. $this->sId = $extra[0];
  10. }
  11. public function run() {
  12. if($this->request['method'] != 'GET') {
  13. $this->setBodyError(500, "arkiwiRequestGetClose: GET method required.");
  14. return;
  15. }
  16. if (!$this->isValid($this->sId)) {
  17. $this->setBodyError(400, "Session invalid or expired.");
  18. return;
  19. }
  20. $this->close($this->sId);
  21. $this->setCode(201);
  22. $this->setBodyJSON(true);
  23. }
  24. }