* The Sone web interface
*/
public FollowSonePage(Template template, WebInterface webInterface) {
- super("followSone.html", template, "Page.FollowSone.Title", webInterface);
+ super("followSone.html", template, "Page.FollowSone.Title", webInterface, true);
}
//
protected void processTemplate(Request request, Template template) throws RedirectException {
super.processTemplate(request, template);
if (request.getMethod() == Method.POST) {
- String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 36);
+ String soneId = request.getHttpRequest().getPartAsStringFailsafe("sone", 44);
String returnPage = request.getHttpRequest().getPartAsStringFailsafe("returnPage", 64);
Sone currentSone = getCurrentSone(request.getToadletContext());
- Sone sone = webInterface.core().getSone(soneId);
- if (!sone.equals(currentSone)) {
- currentSone.addFriend(sone);
- }
+ currentSone.addFriend(soneId);
+ webInterface.getCore().saveSone(currentSone);
throw new RedirectException(returnPage);
}
}
- //
- // SONETEMPLATEPAGE METHODS
- //
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected boolean requiresLogin() {
- return true;
- }
-
}