Exemplo n.º 1
0
 /**
  * Set single user mode and disable the trashbin app
  */
 protected function forceSingleUserAndTrashbin()
 {
     $this->wasTrashbinEnabled = $this->appManager->isEnabledForUser('files_trashbin');
     $this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleuser', false);
     $this->config->setSystemValue('singleuser', true);
     $this->appManager->disableApp('files_trashbin');
 }
Exemplo n.º 2
0
 /**
  * @param IManager $encryptionManager
  * @param IAppManager $appManager
  * @param IConfig $config
  * @param QuestionHelper $questionHelper
  */
 public function __construct(IManager $encryptionManager, IAppManager $appManager, IConfig $config, QuestionHelper $questionHelper)
 {
     parent::__construct();
     $this->appManager = $appManager;
     $this->encryptionManager = $encryptionManager;
     $this->config = $config;
     $this->questionHelper = $questionHelper;
     $this->wasTrashbinEnabled = $this->appManager->isEnabledForUser('files_trashbin');
     $this->wasSingleUserModeEnabled = $this->config->getSystemValue('singleuser', false);
     $this->config->setSystemValue('singleuser', true);
     $this->appManager->disableApp('files_trashbin');
 }
Exemplo n.º 3
0
 protected function execute(InputInterface $input, OutputInterface $output)
 {
     $appId = $input->getArgument('app-id');
     if ($this->manager->isInstalled($appId)) {
         try {
             $this->manager->disableApp($appId);
             $output->writeln($appId . ' disabled');
         } catch (\Exception $e) {
             $output->writeln($e->getMessage());
             return 2;
         }
     } else {
         $output->writeln('No such app enabled: ' . $appId);
     }
 }
Exemplo n.º 4
0
 public function testDisableApp()
 {
     $this->expectClearCache();
     $this->manager->disableApp('test');
     $this->assertEquals('no', $this->appConfig->getValue('test', 'enabled', 'no'));
 }
Exemplo n.º 5
0
 /**
  * @param array $parameters
  * @return OC_OCS_Result
  */
 public function disable($parameters)
 {
     $app = $parameters['appid'];
     $this->appManager->disableApp($app);
     return new OC_OCS_Result(null, 100);
 }