private Response result(String f, String username, String password) {
Response result = null;
try {
Administrator admin = new Administrator(username, password);
ResponseBuilder rb = null;
if ("html".equals(f)) {
rb = Response.ok(generateHTMLResult(admin));
if (admin.isAuthorized()) {
int maxAge = 60 * ConfigManager.getServerConfig()
.getAdminCookieMaxageMinutes();
NewCookie cookieUsername = new NewCookie("username", admin
.getUsername(), null, null, null, maxAge, false);
NewCookie cookiePassword = new NewCookie("password", admin
.getPassword(), null, null, null, maxAge, false);
rb.cookie(cookieUsername, cookiePassword);
}
}