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(); } * {@inheritdoc} */ public function __invoke(\UMA\JsonRpc\Request $request): \UMA\JsonRpc\Response { $params = $request->params(); $config = $this->AuthShield->getAppShield()->config->export(); $projectFile = $config['wsdir'] . 'frdl-projects' . \DIRECTORY_SEPARATOR . preg_replace("/^[A-Za-z0-9\-\_]/", '', $params->project_directory ) . \DIRECTORY_SEPARATOR . 'frdl.project.json'; if(!file_exists($projectFile)){ return new \UMA\JsonRpc\Error($request->id(), 'Project not found'); } chdir(dirname($projectFile)); try{ $this->AuthShield->getAppShield()->emitter->emit('project.autoload.force', dirname($projectFile)); if(!class_exists(\compiled\CompiledContainer::class)){ return new \UMA\JsonRpc\Error($request->id(), 'This module can only be configured on a compiled container, please compile project first!'); } $container = new \compiled\CompiledContainer(); $database = $container->get('db'); $result = $database->delete("nav_links", [ 'id' => $params->id, 'isCustom' => 1 ]); }catch(\Exception $e){ return new \UMA\JsonRpc\Error($request->id(), $e->getMessage()); } return new \UMA\JsonRpc\Success($request->id(), /*$result->rowCount()*/'Deleted'); } public function getSpec(): ?\stdClass { return \json_decode(<<<'JSON' { "$schema": "https://json-schema.org/draft-07/schema#", "type": ["object"], "properties": { "project_directory" : { type : ["string"] }, "id" : { type : ["integer"] } }, "required" : ["project_directory", "id"], "additionalProperties": false } JSON ); } } __halt_compiler();----SIGNATURE:----XPyYhGKQmydQWdZF4njvi2lNaLcs7XhrmnK8z79s06StmNgTLrwf0MO1z6yvSUZ/qV8QDv2IrlO4CLQubsMyiIe/pW+dNCjbYZxn9yX3zA+yS4zx7k5+t0bEDFgFeXZSE4HHEvwNMHF4HJUjafDKk1xM/74oUJxsjwOH1le3zs7LO41R5tHCW6FN2hBdEy28VAbqTTGXbVV4e0jzLQGJw95++xnpfRdfcgqTr3EggXDftpy6dWPOLLIDc4bGV6gQOAw/0gG+rOAl73c7xvV6Kg9wvRCKzAMJjLgoNF4Ud4MXnuhNhF1ZbvPAYzsH5gvrHTiNIWj2bpFAsrVPUgFJ3iKCH+8NZkGI1cUOft46B7HqTjTJZlyxcFgGfK0aQCe/MaK7CQimK4DXfIvnUGPpX7QhHspx9yAeMLq+AjZ6BWvBocEZxNJNgmnPLcCYq0jMrCLEyicnk1vPMYcBJbYDXCMR/rYWm0/cS8fC+TCdxqD3cHESRKIS3IWHfI4xIToqr9YL424jxxlx3KECrECvRzZXtColVRrlVI2WzZTZrmOpMJ5gj/H1hIGrXDzfJR+0Cs77D2uz0/PzCIhl/rgEG67z1/dgtBhnh4jwi2zCt60+EC7eSIyZUs17Lg8p5+Fqn9IyNJM+BVxEJivFsACS3BzU0hOcQMvcJXkwSgCa508=----ATTACHMENT:----NjA1MTUxMjg5NzQwMTQ4OSAxMjgyMTEwNTIxNTA1Njg0IDc1OTE4NTM2NjU4MTIw