aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/App
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2019-07-23 10:28:47 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2019-08-15 11:12:45 +0200
commit810ee7d811c4cf0291add770cb89e5b6d11104b9 (patch)
tree329b6656be47cfeca48239722b55df0a8a1e4bc4 /lib/private/App
parentf6c34240395bd53e160bdc8bac10e504451553b8 (diff)
downloadnextcloud-server-810ee7d811c4cf0291add770cb89e5b6d11104b9.tar.gz
nextcloud-server-810ee7d811c4cf0291add770cb89e5b6d11104b9.zip
Make the auto-disabled list more broad
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/App')
-rw-r--r--lib/private/App/AppManager.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/lib/private/App/AppManager.php b/lib/private/App/AppManager.php
index db286d7ad7d..322731d677c 100644
--- a/lib/private/App/AppManager.php
+++ b/lib/private/App/AppManager.php
@@ -91,6 +91,9 @@ class AppManager implements IAppManager {
/** @var array */
private $appVersions = [];
+ /** @var array */
+ private $autoDisabledApps = [];
+
/**
* @param IUserSession $userSession
* @param AppConfig $appConfig
@@ -168,6 +171,13 @@ class AppManager implements IAppManager {
}
/**
+ * @return array
+ */
+ public function getAutoDisabledApps(): array {
+ return $this->autoDisabledApps;
+ }
+
+ /**
* @param string $appId
* @return array
*/
@@ -351,12 +361,18 @@ class AppManager implements IAppManager {
* Disable an app for every user
*
* @param string $appId
+ * @param bool $automaticDisabled
* @throws \Exception if app can't be disabled
*/
- public function disableApp($appId) {
+ public function disableApp($appId, $automaticDisabled = false) {
if ($this->isAlwaysEnabled($appId)) {
throw new \Exception("$appId can't be disabled.");
}
+
+ if ($automaticDisabled) {
+ $this->autoDisabledApps[] = $appId;
+ }
+
unset($this->installedAppsCache[$appId]);
$this->appConfig->setValue($appId, 'enabled', 'no');