diff --git a/lib/private/User/SyncService.php b/lib/private/User/SyncService.php index 604f0a5bff77..b6689d60d35c 100644 --- a/lib/private/User/SyncService.php +++ b/lib/private/User/SyncService.php @@ -23,7 +23,9 @@ use OCP\AppFramework\Db\DoesNotExistException; use OCP\IConfig; use OCP\ILogger; +use OCP\User\IProvidesEMailBackend; use OCP\User\IProvidesExtendedSearchBackend; +use OCP\User\IProvidesQuotaBackend; use OCP\UserInterface; /** @@ -137,13 +139,21 @@ 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) { - $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);