mraible commented on code in PR #170:
URL: https://github.com/apache/roller/pull/170#discussion_r3891439315
##########
app/src/main/java/org/apache/roller/weblogger/ui/struts2/core/Setup.java:
##########
@@ -64,46 +70,49 @@ public boolean isWeblogRequired() {
@Override
public String execute() {
-
- try {
- WeblogManager mgr =
WebloggerFactory.getWeblogger().getWeblogManager();
- setWeblogs(mgr.getWeblogs(true, null, null, null, 0, -1));
- } catch (WebloggerException ex) {
- LOG.error("Error getting weblogs", ex);
- addError("frontpageConfig.weblogs.error");
- }
try {
setUserCount(WebloggerFactory.getWeblogger().getUserManager().getUserCount());
setBlogCount(WebloggerFactory.getWeblogger().getWeblogManager().getWeblogCount());
} catch (WebloggerException ex) {
LOG.error("Error getting user/weblog counts", ex);
}
-
- return SUCCESS;
- }
- public String save() {
- PropertiesManager mgr =
WebloggerFactory.getWeblogger().getPropertiesManager();
- try {
- RuntimeConfigProperty frontpageBlogProp =
mgr.getProperty("site.frontpage.weblog.handle");
- frontpageBlogProp.setValue(frontpageBlog);
- mgr.saveProperty(frontpageBlogProp);
-
- RuntimeConfigProperty aggregatedProp =
mgr.getProperty("site.frontpage.weblog.aggregated");
- aggregatedProp.setValue(aggregated.toString());
- mgr.saveProperty(aggregatedProp);
+ // A site with no users cannot have an administrator yet, so the
+ // bootstrap instructions are shown to anyone. Nothing about the site's
+ // contents is exposed here: registering the first user is the only
+ // thing that can usefully be done.
+ if (getUserCount() == 0) {
+ setBootstrap(true);
+ return SUCCESS;
+ }
- WebloggerFactory.getWeblogger().flush();
+ // Beyond that point this is a site configuration screen.
+ if (!isUserIsAdmin()) {
Review Comment:
With `users.firstUserAdmin=false` (documented in `roller.properties`) no
account ever passes `isUserIsAdmin()`, and `frontpageSetup!save` and
`globalConfig` are admin-only too, so the frontpage can never be chosen and `/`
stays broken. The removed `setup!save` was the only non-admin path; if it goes,
the description should say how such installs are expected to finish setup.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]