$appId = $this->appManager->cleanAppId($appId);
$result = $this->installer->removeApp($appId);
if ($result !== false) {
+ // If this app was force enabled, remove the force-enabled-state
+ $this->appManager->ignoreNextcloudRequirementForApp($appId, false);
$this->appManager->clearAppsCache();
return new JSONResponse(['data' => ['appid' => $appId]]);
}
return isset($installedApps[$appId]);
}
- public function ignoreNextcloudRequirementForApp(string $appId): void {
+ public function ignoreNextcloudRequirementForApp(string $appId, bool $enabled = true): void {
$ignoreMaxApps = $this->config->getSystemValue('app_install_overwrite', []);
- if (!in_array($appId, $ignoreMaxApps, true)) {
+ if ($enabled && !in_array($appId, $ignoreMaxApps, true)) {
$ignoreMaxApps[] = $appId;
- $this->config->setSystemValue('app_install_overwrite', $ignoreMaxApps);
+ } elseif ($enabled === false) {
+ $ignoreMaxApps = array_filter($ignoreMaxApps, fn (string $id) => $id !== $appId);
}
+ $this->config->setSystemValue('app_install_overwrite', $ignoreMaxApps);
}
public function loadApp(string $app): void {