aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-03-01 11:26:18 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-03-01 11:26:18 +0100
commit256dfd27b6129f9eba205bf4195246c0cac6045b (patch)
tree7a4ab974f15bd8253919c81d2c6cc54787422098 /lib
parent1652541150f4e8d4c8bb147c81238780cf888e45 (diff)
parent1dbe240b0e5b0a0b32d0e0eca596bf4e510f980e (diff)
downloadnextcloud-server-256dfd27b6129f9eba205bf4195246c0cac6045b.tar.gz
nextcloud-server-256dfd27b6129f9eba205bf4195246c0cac6045b.zip
Merge pull request #17451 from owncloud/apps-disablebrokenappafterenable
Disable app that bricks the server after enabling
Diffstat (limited to 'lib')
-rw-r--r--lib/base.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/lib/base.php b/lib/base.php
index df4e91dda9f..31d96666985 100644
--- a/lib/base.php
+++ b/lib/base.php
@@ -823,12 +823,28 @@ class OC {
exit();
}
- $request = \OC::$server->getRequest()->getPathInfo();
- if (substr($request, -3) !== '.js') { // we need these files during the upgrade
+ $request = \OC::$server->getRequest();
+ $requestPath = $request->getPathInfo();
+ if (substr($requestPath, -3) !== '.js') { // we need these files during the upgrade
self::checkMaintenanceMode();
self::checkUpgrade();
}
+ // emergency app disabling
+ if ($requestPath === '/disableapp'
+ && $request->getMethod() === 'POST'
+ && ((string)$request->getParam('appid')) !== ''
+ ) {
+ \OCP\JSON::callCheck();
+ \OCP\JSON::checkAdminUser();
+ $appId = (string)$request->getParam('appid');
+ $appId = \OC_App::cleanAppId($appId);
+
+ \OC_App::disable($appId);
+ \OC_JSON::success();
+ exit();
+ }
+
// Always load authentication apps
OC_App::loadApps(['authentication']);