Esempio n. 1
0
 /**
  * @param IOutput $output
  */
 public function run(IOutput $output)
 {
     $output->startProgress(4);
     $this->removeCalendarShares($output);
     $this->removeContactShares($output);
     $output->finishProgress();
 }
 /**
  * @inheritdoc
  */
 public function run(IOutput $output)
 {
     $output->startProgress();
     $output->advance(1, "Migrate states");
     $this->convStateMapper->migrate();
     $output->finishProgress();
 }
 /**
  * @param IOutput $output
  */
 public function run(IOutput $output)
 {
     $output->startProgress(2);
     $this->fixUserRootPermissions();
     $output->advance();
     $this->fixAvatarPermissions();
     $output->finishProgress();
 }
Esempio n. 4
0
 /**
  * @inheritdoc
  */
 public function run(IOutput $output)
 {
     $output->startProgress();
     $this->userManager->callForAllUsers(function ($user) use($output) {
         /** @var IUser $user */
         $output->advance(1, $user->getDisplayName());
         $this->birthdayService->syncUser($user->getUID());
     });
     $output->finishProgress();
 }
Esempio n. 5
0
 /**
  * Run repair step.
  * Must throw exception on error.
  *
  * @throws \Exception in case of failure
  */
 public function run(IOutput $output)
 {
     $tables = $this->oldDatabaseTables();
     $output->startProgress(count($tables));
     foreach ($this->oldDatabaseTables() as $tableName) {
         if ($this->connection->tableExists($tableName)) {
             $this->connection->dropTable($tableName);
         }
         $output->advance(1, "Drop old database table: {$tableName}");
     }
     $output->finishProgress();
 }
Esempio n. 6
0
 /**
  * @param IOutput $output
  */
 private function removeRootShares(IOutput $output)
 {
     $function = function (IUser $user) use($output) {
         $userFolder = $this->rootFolder->getUserFolder($user->getUID());
         $fileId = $userFolder->getId();
         $qb = $this->connection->getQueryBuilder();
         $qb->delete('share')->where($qb->expr()->eq('file_source', $qb->createNamedParameter($fileId)))->andWhere($qb->expr()->orX($qb->expr()->eq('item_type', $qb->expr()->literal('file')), $qb->expr()->eq('item_type', $qb->expr()->literal('folder'))));
         $qb->execute();
         $output->advance();
     };
     $userCount = $this->countUsers();
     $output->startProgress($userCount);
     $this->userManager->callForAllUsers($function);
     $output->finishProgress();
 }