method) { case "DELETE": if (! ($request->authOK)) { throw new foxException("Bad request", 501); } $request->token->delete(); return; case "GET": if ($request->authOK) { $modules=[]; $i = 0; foreach (modules::listInstalled() as $mod) { if (array_search("menu", $mod->features) !== false && $request->user->checkAccess($mod->globalAccessKey, $mod->name) && ! empty($mod->menuItem)) { $i ++; $modules[($mod->modPriority * 100) + $i] = [ "name" => $mod->name, "instanceOf" => $mod->instanceOf, "menu" => $mod->menuItem, "globalAccesKey" => $mod->globalAccessKey, "languages" => $mod->languages ]; } } return [ "updated" => time(), "user" => $request->token->user, "acls" => $request->user->getAccessRules(), "modules" => $modules ]; } ; throw new foxException("Unauthorized", 401); break; } } } ?>