getRequestExtra(); $this->item64 = $extra[0]; $this->path = DIRECTORY_SEPARATOR.decoder($extra[0]); } public function run() { $result = false; if($this->request['method'] != 'POST') { $this->setBodyError(500, "arkiwiRequestPostCreateDirectory: POST method required."); return; } if (!startsWith($this->path,$_SESSION['authstate']['dir'])) { report(REPPRIO::FATAL, "No permission to create a new directory inside ".$this->path); $this->setBodyError(401, "No permission to create a new directory inside ".$this->path); return; } $input = file_get_contents('php://input'); $obj = json_decode($input); if (property_exists($obj, 'directory')) { $result = data_mkdir($this->path, $obj->directory); } else { report(REPPRIO::FATAL, "No new directory name found."); $this->setBodyError(401, "No new directory name found."); return; } if ($result) { $this->setCode(201); $this->setBodyJSON(true); } else { $this->setCode(201); $this->setBodyJSON(false); } } }