-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Move admin_audit to proper event listeners v2 #47865
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
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.
| $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 <[email protected]>
Signed-off-by: Thomas Citharel <[email protected]>
Based on work from #32019 Signed-off-by: Thomas Citharel <[email protected]>
Signed-off-by: Thomas Citharel <[email protected]>
Signed-off-by: Côme Chilliet <[email protected]>
f52dda0 to
ec37338
Compare
| */ | ||
| class FileEventListener extends Action implements IEventListener { | ||
| public function handle(Event $event): void { | ||
| if ($event instanceof BeforePreviewFetchedEvent) { |
Check notice
Code scanning / Psalm
RedundantConditionGivenDocblockType
Signed-off-by: Côme Chilliet <[email protected]>
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 <[email protected]>
miaulalala
left a comment
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 <[email protected]> Signed-off-by: Côme Chilliet <[email protected]>
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