aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/App/AppManager.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/App/AppManager.php')
-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');