forward = mapping.findForward("createWebsite.page");
} else try {
RollerContext rollerContext = RollerContext.getRollerContext();
UserData user =
RollerSession.getRollerSession(request).getAuthenticatedUser();
UserManager mgr = roller.getUserManager();
if (!RollerConfig.getBooleanProperty("groupblogging.enabled")) {
List permissions = roller.getUserManager().getAllPermissions(user);
if (permissions.size() > 0) {
// sneaky user trying to get around 1 blog limit that applies
// only when group blogging is disabled
return mapping.findForward("access-denied");
}
}
WebsiteData wd = new WebsiteData(
form.getHandle(),
user,
form.getName(),
form.getDescription(),
form.getEmailAddress(),
form.getEmailAddress(),
form.getTheme(),
form.getLocale(),
form.getTimeZone());
try {
String def = RollerRuntimeConfig.getProperty("users.editor.pages");
String[] defs = Utilities.stringToStringArray(def,",");
wd.setEditorPage(defs[0]);
} catch (Exception ex) {
log.error("ERROR setting default editor page for weblog", ex);
}
mgr.addWebsite(wd);
RollerFactory.getRoller().flush();
request.setAttribute("model",
new CreateWebsitePageModel(request, response, mapping, website));