You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Setting it to the second user as admin shows a spinner and never stops.
Also: if setting it through the user's personal page, when opening the link to validate the email address there will be an "Internal Server Error" page.
Additional potential issues (to be tested)
if LDAP has two users where both have the same email address (ex: an admin who has two accounts, one as admin, one as regular user but still wishes to receive email to the same address), it is likely to break on sync.
Just discovered this myself when using the guest app and trying to add a user with an address that I specified for another user before. Anyway for the guest app it should share with the user that specified the respective address instead of creating a new user. Will provide this as feedback for guests separately.
@DeepDiver1975 now that #27635 is merged it is possible to break the update this way:
Setup stable9.1
Create two users with the same email address
Upgrade to master
± % ./occ upgrade
ownCloud or one of the apps require upgrade - only a limited number of commands are available
You may use your browser or the occ upgrade command to do the upgrade
Set log level to debug
Turned on maintenance mode
Updating database schema
Doctrine\DBAL\Exception\UniqueConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_accounts`(`lower_user_id`,`user_id`,`state`,`backend`,`home`,`display_name`,`email`) VALUES(?,?,?,?,?,?,?)' with params ["user2", "user2", 1, "OC\\User\\Database", "\/srv\/www\/htdocs\/owncloud\/data\/user2", "user2", "vincent@petry"]:
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'vincent@petry' for key 'UNIQ_907AA303E7927C74'
Update failed
Maintenance mode is kept active
Reset log level
you can login with the email field, so I would expect that we prevent adding an email that is already used. What is the solution in mind? @pmaier1@hodyroff
This only works if a single user has an email address set.
If two users have the same email address then the login is denied. This was the logic in 9.1.
If we do want to keep blocking duplicate emails, then we need to think about how to migrate setups that had duplicate emails in the past.
And here I'm only talking about DB users.
LDAP might also have entries where multiple users have the same email address, but login with email feature only applies to DB users. For LDAP users, the admin can configure the login fields in the LDAP wizard. Now I don't know what happens with LDAP if two users has the same email address and email is set as login field... @jvillafanez@davitol can you try this out ?
Talked with @DeepDiver1975 and this is the way we'll go:
duplicate email addresses are forbidden (previous versions did allow that)
when upgrading, only pick the first email address found (first found user, not necessarily alphabetical). second user who has the email address will get an empty field, no failure
when importing users from LDAP or other user backends (occ user:sync), write an empty email address in case it is duplicate with another one
log a warning when a duplicate was found for admins to track the problem
This also means that if a user tries to manually set an email address to an existing one, we'll show a warning "email address already in use in the system, please use another one". This could make it possible for a user to guess what users has an account on the system. Probably not a real security risk, @Peter-Prochaska please confirm.
If we consider this a potential risk, then we need to not show an error message but keep the regular "an email has been sent for confirmation" but not actually send anything ?
At least endless spinner and internal server error issues (mentioned in OP) need to be fixed. For many users the mail address is the only unique identifier for e.g. receiving shares or for preventing duplicate accounts. Therefore I don't think we are going to change the basic design on this unless there are other important arguments.
It should be possible to set the uid / login to an email-like string. This should provide something similar to a login by email although it's in fact a regular login. Note that in this case, that uid won't be changeable.
Another more complex approach could be that, from a list of emails that a user could have, mark one of those as "possible to log in with". In this case, we have to verify if such email is unique before allowing it. Then we can use that email to login with that user.
During user sync, any (valid?) email can be added into the DB, but none of them will be set as "possible to log in with".
While this should solve the problems regarding login with email, there could be other problems with the email usage. If I want to send an email, what email address should I use? what if several users have the same email?
In any case, I don't think this will be an easy change to do, so we have to check if this is worthy, and the scenarios and setups where this can be useful.
Activity
pmaier1 commentedon Apr 11, 2017
Just discovered this myself when using the guest app and trying to add a user with an address that I specified for another user before. Anyway for the guest app it should share with the user that specified the respective address instead of creating a new user. Will provide this as feedback for guests separately.
PVince81 commentedon Apr 12, 2017
@DeepDiver1975 now that #27635 is merged it is possible to break the update this way:
felixboehm commentedon Apr 13, 2017
you can login with the email field, so I would expect that we prevent adding an email that is already used. What is the solution in mind?
@pmaier1 @hodyroff
PVince81 commentedon Apr 13, 2017
This only works if a single user has an email address set.
If two users have the same email address then the login is denied. This was the logic in 9.1.
If we do want to keep blocking duplicate emails, then we need to think about how to migrate setups that had duplicate emails in the past.
And here I'm only talking about DB users.
LDAP might also have entries where multiple users have the same email address, but login with email feature only applies to DB users. For LDAP users, the admin can configure the login fields in the LDAP wizard. Now I don't know what happens with LDAP if two users has the same email address and email is set as login field... @jvillafanez @davitol can you try this out ?
PVince81 commentedon Apr 18, 2017
Talked with @DeepDiver1975 and this is the way we'll go:
PVince81 commentedon Apr 18, 2017
This also means that if a user tries to manually set an email address to an existing one, we'll show a warning "email address already in use in the system, please use another one". This could make it possible for a user to guess what users has an account on the system. Probably not a real security risk, @Peter-Prochaska please confirm.
If we consider this a potential risk, then we need to not show an error message but keep the regular "an email has been sent for confirmation" but not actually send anything ?
PVince81 commentedon Apr 18, 2017
And if an admin manually sets a duplicate email address there will directly get an error in the UI.
PVince81 commentedon Apr 18, 2017
50 remaining items
pmaier1 commentedon Feb 5, 2018
At least endless spinner and internal server error issues (mentioned in OP) need to be fixed. For many users the mail address is the only unique identifier for e.g. receiving shares or for preventing duplicate accounts. Therefore I don't think we are going to change the basic design on this unless there are other important arguments.
jvillafanez commentedon Feb 8, 2018
It should be possible to set the uid / login to an email-like string. This should provide something similar to a login by email although it's in fact a regular login. Note that in this case, that uid won't be changeable.
Another more complex approach could be that, from a list of emails that a user could have, mark one of those as "possible to log in with". In this case, we have to verify if such email is unique before allowing it. Then we can use that email to login with that user.
During user sync, any (valid?) email can be added into the DB, but none of them will be set as "possible to log in with".
While this should solve the problems regarding login with email, there could be other problems with the email usage. If I want to send an email, what email address should I use? what if several users have the same email?
In any case, I don't think this will be an easy change to do, so we have to check if this is worthy, and the scenarios and setups where this can be useful.
stale commentedon Sep 21, 2021
This issue has been automatically closed.