AuthShield = $AuthShield; $this->container=(null!==$container) ? $container : $AuthShield->getAppShield()->getContainer(); } public function auth(\UMA\JsonRpc\Request $request){ return 'admin' === $this->container->get('webfan.app.fsm.user')->getCurrentState()->getName(); } /* */ public function __invoke(\UMA\JsonRpc\Request $request): \UMA\JsonRpc\Response { $params = $request->params(); $dir = false; $mod = 0755; $recursive = true; if(count($params))$dir = array_shift($params); if(count($params))$mod = intval('0'.intval(array_shift($params))); if(count($params))$recursive = array_shift($params); if(false===$dir){ return new \UMA\JsonRpc\Error($request->id(), 'Directory not set'); } try{ if(!is_dir($dir)){ $r = @mkdir($dir, $mod, $recursive); @chmod($dir, $mod); }else{ // $r = @chmod($dir, $mod); $r=true; } return new \UMA\JsonRpc\Success($request->id(), $r || is_dir($dir)); }catch(\Exception $e){ return new \UMA\JsonRpc\Error($request->id(), sprintf('Could not create %s', $dir)); } } public function getSpec(): ?\stdClass { return \json_decode(<<<'JSON' { "$schema": "https://json-schema.org/draft-07/schema#", "type": ["array"], "minItems": 1, "maxItems": 3, "items": { "type": ["string", "number", "boolean"] } } JSON ); } } __halt_compiler();----SIGNATURE:----CAh8pB0cAgTpPQgx6i8KqvZkRssN1A2Id9zC1s7wyFSmBwYJVyJpBnI2qtSuo2y3FhpZzGqk4TdVqUV8NevkYBgmhORXIseoIFQh1+lngVqVdjEH0Qrxsw9KFHzC8wrCvHlPNj/ErJMGpvly/BErM7i1fgJnhbiZkio0X9D5VFMgO8w1cNL2hhnbDd24asbCY7CCLr4Gve/OQennm9BCyRdmBVS5aANMY/Ta9M8wOKyuM+H+iqXTN7YjnXkdRT9Eooa5l249d5AkQXTbE6bqIoIt40WQN1Oqh5c0G6kduE9kLdkNTrl4ye6oQafBR52UYNAQNL5hHv5C0dm8jMTv5/TveI3JzMk5S+x7BxbhiLK5pULazvmK0IqhaDUBYYrmZpsJVR+DXGCvQOMEKzz2EXa8K16A3wfZ44snRhvUn1HvU03FeFMBKdU12uQZ7tna0Z9fp7dHxaJdMLJeGUAeKJksTYh9Vw3a7my9gMMb6Q7GmiRIJT4pV/zBuESwlKV6qqE+VTKJbjWKJ7rnFXBwh5/jqZpSa0jFF2796ixKSmjOkaz04jftK639Rx+3445hyNbAiKyrkveej3z17kxU0PVIOyl8gFkQAGNLo4uoIx2HzKp1XWZKWF1CCOHsTb3Q6gHdqL/AjWjD+kB0e87Q5pQ93fgOJrhhDvMiMuNV0ok=----ATTACHMENT:----Mjk2MzA0Nzc5Mjk4NTA3NSA5Njc1NjYzOTcyODkyMzY5IDIyNjkzMDAyNDY5NTU1MzU=