Skip to content

fix: revive always storing lowercased email addresses in AllConfig #53615

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

st3iny
Copy link
Member

@st3iny st3iny commented Jun 20, 2025

Summary

This fix was first implemented in #30197 but got lost.

Before: Mixed case emails (from LDAP) are saved as is in oc_preferences.
After: Mixed case emails are saved in lowercase in oc_preferences.

TODO

  • Needs a migration of existing broken values

Checklist

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny st3iny self-assigned this Jun 20, 2025
@st3iny st3iny added this to the Nextcloud 32 milestone Jun 20, 2025
@github-project-automation github-project-automation bot moved this to 🏗️ In progress in 💌 📅 👥 Groupware team Jun 20, 2025
@st3iny
Copy link
Member Author

st3iny commented Jun 20, 2025

/backport to stable31

@st3iny
Copy link
Member Author

st3iny commented Jun 20, 2025

/backport to stable30

@st3iny st3iny added 3. to review Waiting for reviews and removed 2. developing Work in progress labels Jun 20, 2025
@st3iny st3iny marked this pull request as ready for review June 20, 2025 08:31
@st3iny st3iny requested a review from a team as a code owner June 20, 2025 08:31
@st3iny st3iny requested review from ArtificialOwl, Altahrim, provokateurin, nickvergessen and juliusknorr and removed request for a team June 20, 2025 08:31
@st3iny st3iny mentioned this pull request Jun 20, 2025
5 tasks
@@ -253,6 +253,10 @@ public function setUserValue($userId, $appName, $key, $value, $preCondition = nu
}
}

if ($appName === 'settings' && $key === 'email') {
Copy link
Member

Choose a reason for hiding this comment

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

should add to UserConfig as well as it otherwise simply breaks again.

I'd also suggest to change the existing or add another integration test to

And sending "PUT" to "/cloud/users/brand-new-user" with
| key | email |
| value | no-reply@nextcloud.com |
And the OCS status code should be "100"
And the HTTP status code should be "200"
And sending "PUT" to "/cloud/users/brand-new-user" with
| key | additional_mail |
| value | no.reply@nextcloud.com |
And the OCS status code should be "100"
And the HTTP status code should be "200"
And sending "PUT" to "/cloud/users/brand-new-user" with
| key | additional_mail |
| value | noreply@nextcloud.com |
And the OCS status code should be "100"
And the HTTP status code should be "200"

which sets it as camel case and afterwards confirms it's lower case with:
Then user "brand-new-user" has
| id | brand-new-user |
| displayname | Brand New User |
| email | no-reply@nextcloud.com |
| additional_mail | no.reply@nextcloud.com;noreply@nextcloud.com |
| phone | +4971125242890 |
| address | Foo Bar Town |
| website | https://nextcloud.com |
| twitter | Nextcloud |

Copy link
Member Author

@st3iny st3iny Jun 20, 2025

Choose a reason for hiding this comment

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

Move the entire if condition to UserConfig or just duplicate it there?

Copy link
Member

Choose a reason for hiding this comment

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

well if one place calls the other, the lower one needs to have it. if both write directly to DB, both need it.

Copy link
Member

Choose a reason for hiding this comment

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

Basically coming from the question, when UserConfig is started being used, will we have the same bug again

@st3iny st3iny added 2. developing Work in progress and removed 3. to review Waiting for reviews labels Jun 20, 2025
@st3iny st3iny marked this pull request as draft June 20, 2025 11:19
@ArtificialOwl
Copy link
Member

@nickvergessen might be cool to have: #53619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🏗️ In progress
Development

Successfully merging this pull request may close these issues.

4 participants