@Override
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
User u;
+ HashMap<String, Object> vars = new HashMap<>();
if (support) {
String info = req.getPathInfo();
int id = Integer.parseInt(info.substring(intStart, info.length() - SUPPORT_PATH.length() + intStart + 1));
resp.sendError(404);
return;
}
+ vars.put("username", u.getPreferredName().toString());
} else {
u = getUser(req);
}
- HashMap<String, Object> vars = new HashMap<>();
vars.put("entries", new OutputableArrayIterable(u.getTrainings(), "entry"));
getDefaultTemplate().output(resp.getWriter(), getLanguage(req), vars);
}
@Override
public boolean isPermitted(AuthorizationContext ac) {
- return ac != null && ( !support || ac.canSupport());
+ if (ac == null) {
+ return false;
+ }
+ if (support) {
+ return ac.canSupport();
+ } else {
+ return ac.getTarget() instanceof User;
+ }
}
}