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