diff options
author | Joas Schilling <coding@schilljs.com> | 2017-04-25 17:11:57 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-04-25 17:20:35 +0200 |
commit | ac0c21f4a7473396677ab5eb461c660532a1558e (patch) | |
tree | 819566c251668c6f3f14763aaa7f7c1c1a225a20 /lib/private/User/User.php | |
parent | 8ef25a7628d44465d4777686227407f9a2067700 (diff) | |
download | nextcloud-server-ac0c21f4a7473396677ab5eb461c660532a1558e.tar.gz nextcloud-server-ac0c21f4a7473396677ab5eb461c660532a1558e.zip |
Trigger change when a user is enabled/disabled
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/User/User.php')
-rw-r--r-- | lib/private/User/User.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index a3be0c24bb9..f55807bc769 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -342,9 +342,13 @@ class User implements IUser { * @param bool $enabled */ public function setEnabled($enabled) { + $oldStatus = $this->isEnabled(); $this->enabled = $enabled; $enabled = ($enabled) ? 'true' : 'false'; - $this->config->setUserValue($this->uid, 'core', 'enabled', $enabled); + if ($oldStatus !== $this->enabled) { + $this->triggerChange('enabled', $enabled); + $this->config->setUserValue($this->uid, 'core', 'enabled', $enabled); + } } /** |