From b021c8c475c05897f6bf7b71b6961f4bbc85b352 Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 10 Mar 2016 13:04:50 +0100 Subject: Birthday events are generated on upgrade --- apps/dav/appinfo/application.php | 15 +++++++++++++++ apps/dav/appinfo/info.xml | 2 +- apps/dav/appinfo/update.php | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) (limited to 'apps/dav/appinfo') diff --git a/apps/dav/appinfo/application.php b/apps/dav/appinfo/application.php index 1dae3d4efbf..d06daf97f54 100644 --- a/apps/dav/appinfo/application.php +++ b/apps/dav/appinfo/application.php @@ -210,4 +210,19 @@ class Application extends App { $this->getContainer()->getServer()->getLogger()->logException($ex); } } + + public function generateBirthdays() { + try { + /** @var BirthdayService $migration */ + $migration = $this->getContainer()->query('BirthdayService'); + $userManager = $this->getContainer()->getServer()->getUserManager(); + + $userManager->callForAllUsers(function($user) use($migration) { + /** @var IUser $user */ + $migration->syncUser($user->getUID()); + }); + } catch (\Exception $ex) { + $this->getContainer()->getServer()->getLogger()->logException($ex); + } + } } diff --git a/apps/dav/appinfo/info.xml b/apps/dav/appinfo/info.xml index 4f1e805d99e..82d0f7cf8a1 100644 --- a/apps/dav/appinfo/info.xml +++ b/apps/dav/appinfo/info.xml @@ -5,7 +5,7 @@ ownCloud WebDAV endpoint AGPL owncloud.org - 0.2.1 + 0.2.2 diff --git a/apps/dav/appinfo/update.php b/apps/dav/appinfo/update.php index aaa36052cd2..fbd41d25f49 100644 --- a/apps/dav/appinfo/update.php +++ b/apps/dav/appinfo/update.php @@ -23,3 +23,4 @@ use OCA\Dav\AppInfo\Application; $app = new Application(); $app->setupCron(); +$app->generateBirthdays(); -- cgit v1.2.3 From 5fc859f7ea5daa597ae638c0b9f7d4c04bdd061a Mon Sep 17 00:00:00 2001 From: Thomas Müller Date: Thu, 10 Mar 2016 14:17:21 +0100 Subject: Generate birthdays on upgrade from 8.2 as well --- apps/dav/appinfo/install.php | 1 + 1 file changed, 1 insertion(+) (limited to 'apps/dav/appinfo') diff --git a/apps/dav/appinfo/install.php b/apps/dav/appinfo/install.php index a7a3220b90f..dc5ae39226e 100644 --- a/apps/dav/appinfo/install.php +++ b/apps/dav/appinfo/install.php @@ -25,3 +25,4 @@ $app = new Application(); $app->setupCron(); $app->migrateAddressbooks(); $app->migrateCalendars(); +$app->generateBirthdays(); -- cgit v1.2.3