From ae80d692b158138fade93882f948ee17195209b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 17 Aug 2017 15:54:37 +0200 Subject: [PATCH 1/2] [stable10] use IProvidesEMailBackend when syncing a backend that supports it --- lib/private/User/SyncService.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/private/User/SyncService.php b/lib/private/User/SyncService.php index 604f0a5bff77..3854628c2092 100644 --- a/lib/private/User/SyncService.php +++ b/lib/private/User/SyncService.php @@ -23,6 +23,7 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\IConfig; use OCP\ILogger; +use OCP\User\IProvidesEMailBackend; use OCP\User\IProvidesExtendedSearchBackend; use OCP\UserInterface; @@ -137,9 +138,13 @@ public function setupAccount(Account $a, $uid) { if ($hasKey) { $a->setLastLogin($value); } - list($hasKey, $value) = $this->readUserConfig($uid, 'settings', 'email'); - if ($hasKey) { - $a->setEmail($value); + if ($this->backend instanceof IProvidesEMailBackend) { + $a->setEmail($this->backend->getEMailAddress($uid)); + } else { + list($hasKey, $value) = $this->readUserConfig($uid, 'settings', 'email'); + if ($hasKey) { + $a->setEmail($value); + } } list($hasKey, $value) = $this->readUserConfig($uid, 'files', 'quota'); if ($hasKey) { From 860592433a83a7e673cf1d381d9f687f2c47820d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 17 Aug 2017 15:57:34 +0200 Subject: [PATCH 2/2] [stable10] use IProvidesQuotaBackend when syncing a backend that supports it --- lib/private/User/SyncService.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/private/User/SyncService.php b/lib/private/User/SyncService.php index 3854628c2092..b6689d60d35c 100644 --- a/lib/private/User/SyncService.php +++ b/lib/private/User/SyncService.php @@ -25,6 +25,7 @@ use OCP\ILogger; use OCP\User\IProvidesEMailBackend; use OCP\User\IProvidesExtendedSearchBackend; +use OCP\User\IProvidesQuotaBackend; use OCP\UserInterface; /** @@ -146,9 +147,13 @@ public function setupAccount(Account $a, $uid) { $a->setEmail($value); } } - list($hasKey, $value) = $this->readUserConfig($uid, 'files', 'quota'); - if ($hasKey) { - $a->setQuota($value); + if ($this->backend instanceof IProvidesQuotaBackend) { + $a->setQuota($this->backend->getQuota($uid)); + } else { + list($hasKey, $value) = $this->readUserConfig($uid, 'files', 'quota'); + if ($hasKey) { + $a->setQuota($value); + } } if ($this->backend->implementsActions(\OC_User_Backend::GET_HOME)) { $home = $this->backend->getHome($uid);