diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-04-09 23:39:02 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-09 23:39:02 +0200 |
commit | acbcc607ea74cfb1b46ab33ee00fd850e080edeb (patch) | |
tree | af4ed5d81a416f4395595860999ea449caaa3eee /lib/private | |
parent | 0fa796fb8512490bf1bf126c9ebfa53300a945c7 (diff) | |
parent | 8b9bd37e4ed566adf6e20262280599108bb57c14 (diff) | |
download | nextcloud-server-acbcc607ea74cfb1b46ab33ee00fd850e080edeb.tar.gz nextcloud-server-acbcc607ea74cfb1b46ab33ee00fd850e080edeb.zip |
Merge pull request #9111 from nextcloud/use-proper-bool-user-disabled-state
Return proper boolean and do not save enabled state in db
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/User/User.php | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/private/User/User.php b/lib/private/User/User.php index 56c489181de..e171a65f8ce 100644 --- a/lib/private/User/User.php +++ b/lib/private/User/User.php @@ -349,13 +349,12 @@ class User implements IUser { * * @param bool $enabled */ - public function setEnabled($enabled) { + public function setEnabled(bool $enabled = true) { $oldStatus = $this->isEnabled(); $this->enabled = $enabled; - $enabled = $enabled ? 'true' : 'false'; if ($oldStatus !== $this->enabled) { $this->triggerChange('enabled', $enabled); - $this->config->setUserValue($this->uid, 'core', 'enabled', $enabled); + $this->config->setUserValue($this->uid, 'core', 'enabled', $enabled ? 'true' : 'false'); } } |