summaryrefslogtreecommitdiffstats
path: root/settings/Controller/AppSettingsController.php
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2018-05-22 08:58:07 +0200
committerJulius Härtl <jus@bitgrid.net>2018-06-06 11:40:09 +0200
commitbb50ee08e94b9c466b0d73547e326394f1424c9c (patch)
tree417757234294e3b8ba152270d0f8f31b2b0cb8c5 /settings/Controller/AppSettingsController.php
parent3b39e9c97196a3141a3087cce4b24e1784879c6f (diff)
downloadnextcloud-server-bb50ee08e94b9c466b0d73547e326394f1424c9c.tar.gz
nextcloud-server-bb50ee08e94b9c466b0d73547e326394f1424c9c.zip
Fix app enabling for groups and allow requesting all apps
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'settings/Controller/AppSettingsController.php')
-rw-r--r--settings/Controller/AppSettingsController.php21
1 files changed, 12 insertions, 9 deletions
diff --git a/settings/Controller/AppSettingsController.php b/settings/Controller/AppSettingsController.php
index 413e54d6ce4..98835dc583e 100644
--- a/settings/Controller/AppSettingsController.php
+++ b/settings/Controller/AppSettingsController.php
@@ -187,7 +187,7 @@ class AppSettingsController extends Controller {
* @param string $requestedCategory
* @return array
*/
- private function getAppsForCategory($requestedCategory) {
+ private function getAppsForCategory($requestedCategory = '') {
$versionParser = new VersionParser();
$formattedApps = [];
$apps = $this->appFetcher->get();
@@ -197,14 +197,16 @@ class AppSettingsController extends Controller {
}
// Skip all apps not in the requested category
- $isInCategory = false;
- foreach($app['categories'] as $category) {
- if($category === $requestedCategory) {
- $isInCategory = true;
+ if ($requestedCategory !== '') {
+ $isInCategory = false;
+ foreach($app['categories'] as $category) {
+ if($category === $requestedCategory) {
+ $isInCategory = true;
+ }
+ }
+ if(!$isInCategory) {
+ continue;
}
- }
- if(!$isInCategory) {
- continue;
}
$nextCloudVersion = $versionParser->getVersion($app['releases'][0]['rawPlatformVersionSpec']);
@@ -496,9 +498,10 @@ class AppSettingsController extends Controller {
* @PasswordConfirmationRequired
*
* @param string $appId
+ * @param array $groups
* @return JSONResponse
*/
- public function enableApp(string $appId, array $groups): JSONResponse {
+ public function enableApp(string $appId, array $groups = []): JSONResponse {
return $this->enableApps([$appId], $groups);
}