Skip to content

Conversation

jlehtoranta
Copy link
Contributor

Summary

The twofactor_enforced configuration parameter should be handled as a boolean value like all the other boolean configuration parameters. This reduces configuration errors at least for those, who might edit config.php directly.

TODO

  • Should we migrate the string values to boolean on current installations? Or make getSystemValueBool return the correct value regardless if it's e.g. 'true' or true?

Checklist

Signed-off-by: Jarkko Lehtoranta <jarkko@bytecap.fi>
Copy link
Member

@nickvergessen nickvergessen left a comment

Choose a reason for hiding this comment

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

Fine by me, but didn't take the time to see if that behaves well on updates

@miaulalala miaulalala removed their request for review March 13, 2024 11:32
@susnux susnux added this to the Nextcloud 30 milestone Apr 18, 2024
Copy link
Member

@st3iny st3iny left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution.

However, this will break existing installations that are using a string, e.g. "false" will evaluate to true when cast to a boolean. I get where you are coming from but let's not refactor what is not broken. I don't know if it is a good idea to migrate config.php files.

Code example: https://3v4l.org/HMTpE

@nickvergessen
Copy link
Member

However, this will break existing installations that are using a string, e.g. "false" will evaluate to true when cast to a boolean.

I always thought getSystemValueBool would cover that....
It definetly should from my POV?

@st3iny
Copy link
Member

st3iny commented Jun 7, 2024

The current implementation is a bit naive: https://github.com/nextcloud/server/blob/master/lib%2Fprivate%2FAllConfig.php#L111

This was referenced Jul 30, 2024
@Altahrim Altahrim mentioned this pull request Aug 5, 2024
@skjnldsv skjnldsv added 2. developing Work in progress stale Ticket or PR with no recent activity and removed 3. to review Waiting for reviews labels Aug 6, 2024
@Altahrim Altahrim mentioned this pull request Aug 7, 2024
@skjnldsv skjnldsv mentioned this pull request Aug 13, 2024
@skjnldsv skjnldsv modified the milestones: Nextcloud 30, Nextcloud 31 Aug 14, 2024
@blizzz blizzz mentioned this pull request Jan 8, 2025
This was referenced Jan 14, 2025
This was referenced Jan 21, 2025
@blizzz blizzz mentioned this pull request Jan 29, 2025
1 task
@blizzz blizzz removed this from the Nextcloud 31 milestone Jan 29, 2025
@blizzz blizzz added this to the Nextcloud 32 milestone Jan 29, 2025
@skjnldsv skjnldsv added the ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) label Aug 19, 2025
This was referenced Aug 22, 2025
This was referenced Sep 2, 2025
This was referenced Sep 25, 2025
@skjnldsv skjnldsv modified the milestones: Nextcloud 32, Nextcloud 33 Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2. developing Work in progress feature: settings ♻️ refactor Refactor code (not a bug fix, not a feature just refactoring) stale Ticket or PR with no recent activity

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants