summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2016-01-14 16:08:18 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2016-01-19 14:29:01 +0100
commitd2285113a891fa2e34f4615c4b30490098577649 (patch)
tree4f5b4850c6c6fadb3a11c4b14a5c503ed8a973cb /core
parentbf9f4f20e152e31c8f3cdf43f0bbc86c58fff409 (diff)
downloadnextcloud-server-d2285113a891fa2e34f4615c4b30490098577649.tar.gz
nextcloud-server-d2285113a891fa2e34f4615c4b30490098577649.zip
Make sure to list "group enabled" apps as enabled
also when they are not enabled for the current user
Diffstat (limited to 'core')
-rw-r--r--core/command/app/listapps.php20
-rw-r--r--core/register_command.php2
2 files changed, 17 insertions, 5 deletions
diff --git a/core/command/app/listapps.php b/core/command/app/listapps.php
index 504944dd707..d7546b3c0c7 100644
--- a/core/command/app/listapps.php
+++ b/core/command/app/listapps.php
@@ -25,11 +25,24 @@
namespace OC\Core\Command\App;
use OC\Core\Command\Base;
+use OCP\App\IAppManager;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class ListApps extends Base {
+
+ /** @var IAppManager */
+ protected $manager;
+
+ /**
+ * @param IAppManager $manager
+ */
+ public function __construct(IAppManager $manager) {
+ parent::__construct();
+ $this->manager = $manager;
+ }
+
protected function configure() {
parent::configure();
@@ -47,10 +60,9 @@ class ListApps extends Base {
protected function execute(InputInterface $input, OutputInterface $output) {
if ($input->getOption('shipped') === 'true' || $input->getOption('shipped') === 'false'){
- $shouldFilterShipped = true;
$shippedFilter = $input->getOption('shipped') === 'true';
} else {
- $shouldFilterShipped = false;
+ $shippedFilter = null;
}
$apps = \OC_App::getAllApps();
@@ -59,10 +71,10 @@ class ListApps extends Base {
//sort enabled apps above disabled apps
foreach ($apps as $app) {
- if ($shouldFilterShipped && \OC_App::isShipped($app) !== $shippedFilter){
+ if ($shippedFilter !== null && \OC_App::isShipped($app) !== $shippedFilter){
continue;
}
- if (\OC_App::isEnabled($app)) {
+ if ($this->manager->isInstalled($app)) {
$enabledApps[] = $app;
} else {
$disabledApps[] = $app;
diff --git a/core/register_command.php b/core/register_command.php
index a7dd7414790..42e2d29ecea 100644
--- a/core/register_command.php
+++ b/core/register_command.php
@@ -47,7 +47,7 @@ if (\OC::$server->getConfig()->getSystemValue('installed', false)) {
$application->add(new OC\Core\Command\App\Disable());
$application->add(new OC\Core\Command\App\Enable());
$application->add(new OC\Core\Command\App\GetPath());
- $application->add(new OC\Core\Command\App\ListApps());
+ $application->add(new OC\Core\Command\App\ListApps(\OC::$server->getAppManager()));
$application->add(new OC\Core\Command\Background\Cron(\OC::$server->getConfig()));
$application->add(new OC\Core\Command\Background\WebCron(\OC::$server->getConfig()));