diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/User/User.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 0a51622428b..e7aa72fafba 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -320,13 +320,17 @@ class User implements IUser { } if ($this->backend->implementsActions(Backend::SET_PASSWORD)) { $result = $this->backend->setPassword($this->uid, $password); - $this->legacyDispatcher->dispatch(IUser::class . '::postSetPassword', new GenericEvent($this, [ - 'password' => $password, - 'recoveryPassword' => $recoveryPassword, - ])); - if ($this->emitter) { - $this->emitter->emit('\OC\User', 'postSetPassword', [$this, $password, $recoveryPassword]); + + if ($result !== false) { + $this->legacyDispatcher->dispatch(IUser::class . '::postSetPassword', new GenericEvent($this, [ + 'password' => $password, + 'recoveryPassword' => $recoveryPassword, + ])); + if ($this->emitter) { + $this->emitter->emit('\OC\User', 'postSetPassword', [$this, $password, $recoveryPassword]); + } } + return !($result === false); } else { return false; |