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:----htE2tWJr0ROMeQBUteXZvt030waYyxiaBXlEGqFNUE8yX5u8qOSDYiL9DL11nyGIMUhsSKeCHjebgTg/TNFpP9Juk2l3ABqOiUPFjg4QHLx40fClFU49Y27pDfw9cIBnEVouhaT5hhC8UhLRLIuG+cYjw+7ViB6BRxj4EbkW32+m/P64MrjbqTP/8OEdQmG7lVJdl5bPQtDk7tNWXawjLK6Nsm9GQqeTcOM0c+TbjC3/D1FhxPdSgpS0H7VjMHsbq0YZJRcQBXYunxxbf496NXZa/2OMM3J7i0a8hySRjkaC6z5xQbbxZcYMGbJAzVallHLc7PRyKZ/MGBgasjzLSCfVG3ZBibK/qpWsJJ9/XxyuEoypSdvPB5QJiSwDvOcE6Ybnha4HoGH8QMInpOvWfrPkPKdXNBggi1Y08GVB4Mlbx1W22+R3iBcPAFNrbX0wbiixEDgZIr18vmr2AJEd/6qVL/sJVJFLJfRVylgqfNuQ/ZsAffC5kBYtLIfy0fvuB4ByiFh8NbEb32MvEE4O1a5wGIeVWmGi1NpoG5rsTAz28NrfeOnzIejwdhVn69Sev5hEaJB6Sm2SrEJgjXYv0WiQMkGZ8ekWM3f9M1GpSB2todFhycINLpsvNIdwvBGAwWFZMIUdsEgYPPKvTQOuQFe45jMpO10ZL4DujNH9EnY=----ATTACHMENT:----NDQ2NzIyNDEyODk3MDYwNSAxNzQwMzY1Mjc1Mjg1ODAxIDk0MzgwNjY1MzE1OTMwMQ==