}
}
- public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): void {
+ public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool {
$setDatabaseValue($enabled);
+ return $enabled;
}
}
return $this->handleRequest($uid, 'isUserEnabled', [$uid, $queryDatabaseValue]);
}
- public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): void {
- $this->handleRequest($uid, 'setUserEnabled', [$uid, $enabled, $queryDatabaseValue, $setDatabaseValue]);
+ public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool {
+ return $this->handleRequest($uid, 'setUserEnabled', [$uid, $enabled, $queryDatabaseValue, $setDatabaseValue]);
}
}
$enabled = $this->config->getUserValue($this->uid, 'core', 'enabled', 'true');
$this->enabled = $enabled === 'true';
}
- return (bool) $this->enabled;
+ return $this->enabled;
};
if ($this->backend instanceof IProvideEnabledStateBackend) {
return $this->backend->isUserEnabled($this->uid, $queryDatabaseValue);
$enabled = $this->config->getUserValue($this->uid, 'core', 'enabled', 'true');
$this->enabled = $enabled === 'true';
}
- return (bool) $this->enabled;
+ return $this->enabled;
};
- $this->backend->setUserEnabled($this->uid, $enabled, $queryDatabaseValue, $setDatabaseValue);
+ $enabled = $this->backend->setUserEnabled($this->uid, $enabled, $queryDatabaseValue, $setDatabaseValue);
if ($oldStatus !== $enabled) {
$this->triggerChange('enabled', $enabled, $oldStatus);
}
namespace OCP\User\Backend;
/**
- * @since 26.0.0
+ * @since 28.0.0
*/
interface IProvideEnabledStateBackend {
/**
- * @since 26.0.0
+ * @since 28.0.0
*
* @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
*/
public function isUserEnabled(string $uid, callable $queryDatabaseValue): bool;
/**
- * @since 26.0.0
+ * @since 28.0.0
*
* @param callable():bool $queryDatabaseValue A callable to query the enabled state from database
* @param callable(bool):void $setDatabaseValue A callable to set the enabled state in the database.
*/
- public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): void;
+ public function setUserEnabled(string $uid, bool $enabled, callable $queryDatabaseValue, callable $setDatabaseValue): bool;
}