add an option to force settings to users

This commit is contained in:
Simon Vieille
2020-09-24 14:26:25 +02:00
parent 4b6a1f2989
commit c7f9fd1b8b
10 changed files with 192 additions and 147 deletions
+2 -1
View File
@@ -55,8 +55,9 @@ class Application extends App
public function isEnabled(): bool
{
$enabled = true;
$isForced = (bool) $this->config->getAppValue(self::APP_ID, 'force', '0');
if (null !== $this->user) {
if (null !== $this->user && !$isForced) {
$enabled = (bool) $this->config->getUserValue($this->user->getUid(), self::APP_ID, 'enabled', '1');
}