Make the emergency disable also accept arrays

Signed-off-by: Lukas Reschke <lukas@statuscode.ch>
This commit is contained in:
Lukas Reschke 2017-04-25 21:19:49 +02:00
parent 732c92e93a
commit d4ba8198fe
No known key found for this signature in database
GPG Key ID: B9F6980CF6E759B1
1 changed files with 6 additions and 5 deletions

View File

@ -935,14 +935,15 @@ class OC {
// emergency app disabling
if ($requestPath === '/disableapp'
&& $request->getMethod() === 'POST'
&& ((string)$request->getParam('appid')) !== ''
&& ((array)$request->getParam('appid')) !== ''
) {
\OCP\JSON::callCheck();
\OCP\JSON::checkAdminUser();
$appId = (string)$request->getParam('appid');
$appId = \OC_App::cleanAppId($appId);
\OC_App::disable($appId);
$appIds = (array)$request->getParam('appid');
foreach($appIds as $appId) {
$appId = \OC_App::cleanAppId($appId);
\OC_App::disable($appId);
}
\OC_JSON::success();
exit();
}