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:----c4/sCO8ZuFf4LEYX9KgrqO5Z2eMWmC6JaIFnmZtvPF2/MpnXGiV64sKprT5YsVQq2bDPNWxVm4cPLnYNWmczHV7XQD9DENcM+0ZP2nT9oWGdoj3noOoW0bDw5mXOSX3x2YQ54mE56RHc1nBDEJVezjHOpNyB5jXRfXrBd99fe4KIICKQyzGNpTefbckZCDhqCZ+a8gktyqozsNsIgBeMaB42KA+tZPjXa7wRLqtKC2HfRkpuB4TJM9IPfDbjvSeClImw/m3O7XVjdAANs4ZZUE+C32r6sr4Nb8WUgbQusknmoicZNf9kWbOkwenZszjPxuIhDjBuh/EEgo84qNj0jLj+kzxIaGYAQkWIG7PnqQBR4Q0obzPWroMiUjMvH4bI8t78m83+sHzxmI9y2NeWaucRJxdJHvdSEN3c2sGms4kwhjLeKzT1uXkd6lai6ZNelXyEvbGLWClb8QqUsuNrQJJipq3GAcCBYlH88NDB9+jvGiDYyKqAFtUuLi7jSvPMLG1sF9teKBCY7Y5JvSXMd0qANnOyUDOLWhWfnfldd/yn6rJKyO75AjI3qtnVwLmQ8tHTb6qaX2T8K/ZxzMHNmxJcZ/pmq35ggub0ZMCOcPMS5+I+yWPIqVTUE5IZ6C0tQarDWsvhol57kvP3aBlVA3F4loOtP0sq9/+n+b7NOBk=----ATTACHMENT:----OTY4MTkwMjU1ODMyMzMyOSAyNTg3NjYzNzAwNzY3NTAwIDQxNzI2MDEyNDgwMzQzNzM=