-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Open
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap33-feedbackbug
Description
- Noticed while working on fix: Make User_Proxy IGetDisplayNameBackend complient #57452
The command occ user:sync-account-data currently updates the displayname, when the backend implements IGetDisplayNameBackend:
server/core/Command/User/SyncAccountDataCommand.php
Lines 58 to 75 in d341c20
| if ($user->getBackend() instanceof IGetDisplayNameBackend) { | |
| try { | |
| $displayNameProperty = $account->getProperty(IAccountManager::PROPERTY_DISPLAYNAME); | |
| } catch (PropertyDoesNotExistException) { | |
| $displayNameProperty = null; | |
| } | |
| if (!$displayNameProperty || $displayNameProperty->getValue() !== $user->getDisplayName()) { | |
| $output->writeln($user->getUID() . ' - updating changed display name'); | |
| $account->setProperty( | |
| IAccountManager::PROPERTY_DISPLAYNAME, | |
| $user->getDisplayName(), | |
| $displayNameProperty ? $displayNameProperty->getScope() : IAccountManager::SCOPE_PRIVATE, | |
| $displayNameProperty ? $displayNameProperty->getVerified() : IAccountManager::NOT_VERIFIED, | |
| $displayNameProperty ? $displayNameProperty->getVerificationData() : '' | |
| ); | |
| $changed = true; | |
| } | |
| } |
But the account data that is used to compare the displayname, always return the up-to-date displayname:
server/lib/private/Accounts/AccountManager.php
Lines 664 to 667 in d341c20
| if ($user->getBackend() instanceof IGetDisplayNameBackend) { | |
| $property = $account->getProperty(self::PROPERTY_DISPLAYNAME); | |
| $account->setProperty(self::PROPERTY_DISPLAYNAME, $user->getDisplayName(), $property->getScope(), $property->getVerified()); | |
| } |
(implemented at #39770)
So if I am not mistaken, occ user:sync-account-data is basically a NOP?
CC @juliusknorr as creator of the occ command.
Metadata
Metadata
Assignees
Labels
0. Needs triagePending check for reproducibility or if it fits our roadmapPending check for reproducibility or if it fits our roadmap33-feedbackbug