-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Move admin_audit to proper event listeners v2 #47865
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Psalm found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
apps/admin_audit/lib/Listener/AppManagementEventListener.php
Dismissed
Show dismissed
Hide dismissed
*/ | ||
class ConsoleEventListener extends Action implements IEventListener { | ||
public function handle(Event $event): void { | ||
if ($event instanceof ConsoleEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType Note
$this->passwordUpdated($event); | ||
} elseif ($event instanceof UserIdAssignedEvent) { | ||
$this->userIdAssigned($event); | ||
} elseif ($event instanceof UserIdUnassignedEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType Note
} elseif (!$isUser) { | ||
$this->dispatcher->dispatchTyped(new UserIdAssignedEvent($name)); | ||
if ($this->ncUserManager instanceof PublicEmitter) { | ||
$this->ncUserManager->emit('\OC\User', 'assignedUserId', [$name]); |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
$this->setInterval( | ||
(int)\OC::$server->getConfig()->getAppValue( | ||
(int)$this->config->getAppValue( |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
$prefixes = $this->ldapHelper->getServerConfigurationPrefixes(true); | ||
if (count($prefixes) === 0) { | ||
return null; | ||
} | ||
|
||
$cycleData = [ | ||
'prefix' => $this->config->getAppValue('user_ldap', 'background_sync_prefix', null), | ||
'prefix' => $this->config->getAppValue('user_ldap', 'background_sync_prefix', 'none'), |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
$this->config->setAppValue('user_ldap', 'background_sync_prefix', $cycleData['prefix']); | ||
$this->config->setAppValue('user_ldap', 'background_sync_offset', $cycleData['offset']); | ||
$this->config->setAppValue('user_ldap', 'background_sync_offset', (string)$cycleData['offset']); |
Check notice
Code scanning / Psalm
DeprecatedMethod Note
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Based on work from #32019 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
f52dda0
to
ec37338
Compare
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
01f9bb4
to
957ac81
Compare
public function handle(Event $event): void { | ||
if ($event instanceof TwoFactorProviderChallengePassed) { | ||
$this->twoFactorProviderChallengePassed($event); | ||
} elseif ($event instanceof TwoFactorProviderChallengeFailed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess it's safe to ignore the psalm warning.
If you want to get rid of it, add "Event" to template-implements.
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks you could implement but don't have to. Otherwise LGTM.
Co-authored-by: Anna <anna@nextcloud.com> Signed-off-by: Côme Chilliet <91878298+come-nc@users.noreply.github.com>
See #32128
Summary
Rebased version of #37193
Part of original PR were already done in master so some commit endup a bit empty, but everything should work.
Does not fix all cases of deprecated mecanism but this is already a good improvement and as such it should be merged before it conflicts again.
Checklist