*/
@Override
protected void processTemplate(FreenetRequest request, TemplateContext templateContext) throws RedirectException {
super.processTemplate(request, templateContext);
Sone currentSone = getCurrentSone(request.getToadletContext());
Profile profile = currentSone.getProfile();
/* get parameters from request. */
String fieldId = request.getHttpRequest().getParam("field");
Field field = profile.getFieldById(fieldId);
if (field == null) {
throw new RedirectException("invalid.html");
}
/* process POST request. */
if (request.getMethod() == Method.POST) {
if (request.getHttpRequest().getPartAsStringFailsafe("confirm", 4).equals("true")) {
fieldId = request.getHttpRequest().getParam("field");
field = profile.getFieldById(fieldId);
if (field == null) {
throw new RedirectException("invalid.html");
}
profile.removeField(field);
currentSone.setProfile(profile);
}
throw new RedirectException("editProfile.html#profile-fields");
}