Skip to content

Follow the weblog creation setting on save, and count every account for the first administrator - #368

Merged
snoopdave merged 2 commits into
roller-6.1.xfrom
weblog-creation-checks-6.1.x
Nov 21, 2026
Merged

snoopdave merged 2 commits into
roller-6.1.xfrom
weblog-creation-checks-6.1.x

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

Two small fixes to account and weblog creation for 6.1.8.

  • Saving "Create weblog" follows the site setting. When "Allow users to create weblogs" is off, saving the form now refuses, as opening it already did.
  • Only the site's first account becomes an administrator. With users.firstUserAdmin on, Roller now counts disabled accounts too before making a new account an administrator.
  • Tests. CreateWeblogSettingTest and FirstUserAdminTest fail without their change. The full 6.1.x unit suite passes on JDK 11 (817 tests).

Not ported to master yet.

Opening the Create weblog form already refused when the site does not let
users create weblogs. Saving it now checks the same setting.
With users.firstUserAdmin on, a new account became an administrator when no
enabled account existed. Disabled accounts now count as well, so only the
site's first account is made an administrator.

@mraible mraible left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Saving now follows the same setting check as opening the form, and counting every account with the new User.getCount query means a disabled account still counts as the first one. Both are as small as they can be. I'm happy to port it to master if that helps.

@snoopdave
snoopdave merged commit 5b87d75 into roller-6.1.x Nov 21, 2026
7 checks passed
@snoopdave
snoopdave deleted the weblog-creation-checks-6.1.x branch November 21, 2026 23:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants