MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / handleAuthedRequest

Method handleAuthedRequest

plugins/webReport/webReport.cpp:159–184  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159bool WebReport::handleAuthedRequest(int level, const HTTPRequest& request, HTTPReply& reply) {
160 evenLine = false;
161 valid = level == 1;
162 reports = NULL;
163
164 reply.returnCode = HTTPReply::e200OK;
165 std::string& page = reply.body;
166
167 std::string action;
168 request.getParam("action", action);
169
170 reply.docType = HTTPReply::eHTML;
171
172 reports = bz_getReports();
173 report = -1;
174
175 if (!templateSystem.processTemplateFile(page, "report.tmpl")) {
176 templateSystem.processTemplate(page, reportDefaultTemplate);
177 }
178
179 if (reports) {
180 bz_deleteStringList(reports);
181 }
182
183 return true;
184}
185
186void WebReport::loadDefaultTemplates(void) {
187 reportDefaultTemplate = "<html><body>[?IF Valid][*START Reports][$Report]<br>[*END Reports]There are no reports, sorry[*EMPTY Reports][?ELSE Valid]Invalid Login, sorry[?END Valid]</body></html>";

Callers

nothing calls this directly

Calls 4

bz_deleteStringListFunction · 0.85
processTemplateFileMethod · 0.80
processTemplateMethod · 0.80
getParamMethod · 0.45

Tested by

no test coverage detected