Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
[stable10] use IProvidesEMailBackend when syncing a backend that supp…
…orts it
  • Loading branch information
butonic authored and DeepDiver1975 committed Aug 18, 2017
commit ae80d692b158138fade93882f948ee17195209b6
11 changes: 8 additions & 3 deletions lib/private/User/SyncService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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) {
Expand Down