if (RollerSession.getRollerSession(request).isGlobalAdminUser())
{
BasePageModel pageModel = new BasePageModel(
"planetConfig.pageTitle", request, response, mapping);
request.setAttribute("model",pageModel);
Roller roller = RollerFactory.getRoller();
PlanetManager planet = roller.getPlanetManager();
PlanetConfigData config = planet.getConfiguration();
if (config == null)
{
config = new PlanetConfigData();
}
PlanetConfigForm form = (PlanetConfigForm) actionForm;
ActionErrors errors = validate(form);
if (errors.isEmpty())
{
form.copyTo(config, request.getLocale());
planet.saveConfiguration(config);
if (planet.getGroup("external") == null)
{
PlanetGroupData group = new PlanetGroupData();
group.setHandle("external");
group.setTitle("external");
planet.saveGroup(group);
}
roller.flush();
ActionMessages messages = new ActionMessages();
messages.add(null, new ActionMessage("planetConfig.success.saved"));
saveMessages(request, messages);
}
else