aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-04-06 20:19:52 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-04-09 11:26:26 +0200
commiteae55761de914f47136e06bafd99898061080a08 (patch)
tree1df890633a5caf2b372af07068d62f1c8caec15b /lib
parente970e9f7106c094d49fd3ed49244fb073b97e381 (diff)
downloadnextcloud-server-eae55761de914f47136e06bafd99898061080a08.tar.gz
nextcloud-server-eae55761de914f47136e06bafd99898061080a08.zip
Properly return boolean on enable state
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/User/User.php5
-rw-r--r--lib/public/IUser.php2
2 files changed, 3 insertions, 4 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');
}
}
diff --git a/lib/public/IUser.php b/lib/public/IUser.php
index 13aa60b3807..3d8515a5e03 100644
--- a/lib/public/IUser.php
+++ b/lib/public/IUser.php
@@ -146,7 +146,7 @@ interface IUser {
* @param bool $enabled
* @since 8.0.0
*/
- public function setEnabled($enabled);
+ public function setEnabled(bool $enabled = true);
/**
* get the users email address