Move admin_audit to proper event listeners v2#47865
Conversation
There was a problem hiding this comment.
Psalm found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
| $this->appEnable($event); | ||
| } elseif ($event instanceof AppDisableEvent) { | ||
| $this->appDisable($event); | ||
| } elseif ($event instanceof AppUpdateEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType
| $this->beforeUserLoggedIn($event); | ||
| } elseif ($event instanceof UserLoggedInWithCookieEvent || $event instanceof UserLoggedInEvent) { | ||
| $this->userLoggedIn($event); | ||
| } elseif ($event instanceof BeforeUserLoggedOutEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType
| */ | ||
| class ConsoleEventListener extends Action implements IEventListener { | ||
| public function handle(Event $event): void { | ||
| if ($event instanceof ConsoleEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType
| $this->passwordUpdated($event); | ||
| } elseif ($event instanceof UserIdAssignedEvent) { | ||
| $this->userIdAssigned($event); | ||
| } elseif ($event instanceof UserIdUnassignedEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType
| } 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
| parent::__construct($timeFactory); | ||
| $this->setInterval( | ||
| (int)\OC::$server->getConfig()->getAppValue( | ||
| (int)$this->config->getAppValue( |
Check notice
Code scanning / Psalm
DeprecatedMethod
|
|
||
| $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
| public function setCycle(array $cycleData): void { | ||
| $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
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.
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>
miaulalala
left a comment
There was a problem hiding this comment.
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