feat: add repair step to ensure guests haven't changed their email - #1370
Merged
Conversation
Signed-off-by: Robin Appelman <robin@icewind.nl>
icewind1991
force-pushed
the
guest-reset-email-repair
branch
from
August 11, 2025 08:27
0a99fe1 to
46f5c9d
Compare
skjnldsv
approved these changes
Aug 11, 2025
Merged
skjnldsv
reviewed
Aug 13, 2025
| public function run(IOutput $output) { | ||
| foreach ($this->guestManager->listGuests() as $guestId) { | ||
| $guest = $this->userManager->get($guestId); | ||
| if (strtolower($guest->getSystemEMailAddress()) !== strtolower($guestId)) { |
Member
There was a problem hiding this comment.
@icewind1991 psalm should have warned us about the potential null, no?
Is psalm even properly working?
Member
There was a problem hiding this comment.
I have it if I show infos
INFO: PossiblyNullArgument - lib/Repair/ResetEmails.php:35:19 - Argument 1 of strtolower cannot be null, possibly null value provided (see https://psalm.dev/078)
if (strtolower($guest?->getSystemEMailAddress()) !== strtolower($guestId)) {
INFO: PossiblyNullArgument - lib/Repair/ResetEmails.php:36:66 - Argument 4 of OCP\IConfig::setUserValue cannot be null, possibly null value provided (see https://psalm.dev/078)
$this->config->setUserValue($guestId, 'guests', 'old_email', $guest->getSystemEMailAddress());
INFO: PossiblyNullReference - lib/Repair/ResetEmails.php:36:74 - Cannot call method getSystemEMailAddress on possibly null value (see https://psalm.dev/083)
$this->config->setUserValue($guestId, 'guests', 'old_email', $guest->getSystemEMailAddress());
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #1369