summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-04-25 18:27:38 -0300
committerGitHub <noreply@github.com>2017-04-25 18:27:38 -0300
commit255c7df3bdbaccf00ba8e9fb00e750ffb9a50356 (patch)
treeb2f987ef6ad40a15744d4fe6bf66443be009f313 /lib
parent417bc606e492236ba9e22263a0ac94ebde821313 (diff)
parent5ee445c54bbd0f29bfc46dce62ee43a127f483aa (diff)
downloadnextcloud-server-255c7df3bdbaccf00ba8e9fb00e750ffb9a50356.tar.gz
nextcloud-server-255c7df3bdbaccf00ba8e9fb00e750ffb9a50356.zip
Merge pull request #4499 from nextcloud/downstream-26984
Trigger change when a user is enabled/disabled
Diffstat (limited to 'lib')
-rw-r--r--lib/private/User/User.php6
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);
+ }
}
/**