summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2018-04-09 23:39:02 +0200
committerGitHub <noreply@github.com>2018-04-09 23:39:02 +0200
commitacbcc607ea74cfb1b46ab33ee00fd850e080edeb (patch)
treeaf4ed5d81a416f4395595860999ea449caaa3eee /lib/private
parent0fa796fb8512490bf1bf126c9ebfa53300a945c7 (diff)
parent8b9bd37e4ed566adf6e20262280599108bb57c14 (diff)
downloadnextcloud-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.php5
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');
}
}