diff options
author | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-08-09 08:17:41 +0200 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2016-11-22 20:17:05 +0100 |
commit | 181af830fd57db710ceae14ac6d577b809333381 (patch) | |
tree | baf4f56e398badde4ed69f6e165c01c33c11e220 /apps/dav/lib/Migration | |
parent | ca3b67703c8f99820136cb3307df64540b460887 (diff) | |
download | nextcloud-server-181af830fd57db710ceae14ac6d577b809333381.tar.gz nextcloud-server-181af830fd57db710ceae14ac6d577b809333381.zip |
Remove 9.1 migration steps in app dav (#25654)
Diffstat (limited to 'apps/dav/lib/Migration')
-rw-r--r-- | apps/dav/lib/Migration/Classification.php | 94 | ||||
-rw-r--r-- | apps/dav/lib/Migration/GenerateBirthdays.php | 71 |
2 files changed, 0 insertions, 165 deletions
diff --git a/apps/dav/lib/Migration/Classification.php b/apps/dav/lib/Migration/Classification.php deleted file mode 100644 index a18646023c8..00000000000 --- a/apps/dav/lib/Migration/Classification.php +++ /dev/null @@ -1,94 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - - -namespace OCA\DAV\Migration; - -use OCA\DAV\CalDAV\CalDavBackend; -use OCP\IUser; -use OCP\IUserManager; -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; - -class Classification implements IRepairStep { - - /** @var CalDavBackend */ - private $calDavBackend; - - /** @var IUserManager */ - private $userManager; - - /** - * Classification constructor. - * - * @param CalDavBackend $calDavBackend - */ - public function __construct(CalDavBackend $calDavBackend, IUserManager $userManager) { - $this->calDavBackend = $calDavBackend; - $this->userManager = $userManager; - } - - /** - * @param IUser $user - */ - public function runForUser($user) { - $principal = 'principals/users/' . $user->getUID(); - $calendars = $this->calDavBackend->getCalendarsForUser($principal); - foreach ($calendars as $calendar) { - $objects = $this->calDavBackend->getCalendarObjects($calendar['id']); - foreach ($objects as $object) { - $calObject = $this->calDavBackend->getCalendarObject($calendar['id'], $object['uri']); - $classification = $this->extractClassification($calObject['calendardata']); - $this->calDavBackend->setClassification($object['id'], $classification); - } - } - } - - /** - * @param $calendarData - * @return integer - * @throws \Sabre\DAV\Exception\BadRequest - */ - protected function extractClassification($calendarData) { - return $this->calDavBackend->getDenormalizedData($calendarData)['classification']; - } - - /** - * @inheritdoc - */ - public function getName() { - return 'Fix classification for calendar objects'; - } - - /** - * @inheritdoc - */ - public function run(IOutput $output) { - $output->startProgress(); - $this->userManager->callForAllUsers(function($user) use ($output) { - /** @var IUser $user */ - $output->advance(1, $user->getDisplayName()); - $this->runForUser($user); - }); - $output->finishProgress(); - } -} diff --git a/apps/dav/lib/Migration/GenerateBirthdays.php b/apps/dav/lib/Migration/GenerateBirthdays.php deleted file mode 100644 index 20e000314ac..00000000000 --- a/apps/dav/lib/Migration/GenerateBirthdays.php +++ /dev/null @@ -1,71 +0,0 @@ -<?php -/** - * @copyright Copyright (c) 2016, ownCloud, Inc. - * - * @author Thomas Müller <thomas.mueller@tmit.eu> - * - * @license AGPL-3.0 - * - * This code is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License, version 3, - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License, version 3, - * along with this program. If not, see <http://www.gnu.org/licenses/> - * - */ - - -namespace OCA\DAV\Migration; - -use OCA\DAV\CalDAV\BirthdayService; -use OCP\IUser; -use OCP\IUserManager; -use OCP\Migration\IOutput; -use OCP\Migration\IRepairStep; - -class GenerateBirthdays implements IRepairStep { - - /** @var BirthdayService */ - private $birthdayService; - - /** @var IUserManager */ - private $userManager; - - /** - * GenerateBirthdays constructor. - * - * @param BirthdayService $birthdayService - * @param IUserManager $userManager - */ - public function __construct(BirthdayService $birthdayService, IUserManager $userManager) { - $this->birthdayService = $birthdayService; - $this->userManager = $userManager; - } - - /** - * @inheritdoc - */ - public function getName() { - return 'Regenerate birthday calendar for all users'; - } - - /** - * @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(); - } -} |