diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-01 12:05:40 +0100 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2015-12-02 21:25:05 +0100 |
commit | eebe2b9c239a7f9e7e127f52ab4b9e97763b0149 (patch) | |
tree | 81d9d855b7b6e0d5fb387cd5e8c6092f17e21de3 /apps/encryption/lib/crypto | |
parent | df5872ec50a68de5d99bd6b5cf17ceb94f2ef833 (diff) | |
download | nextcloud-server-eebe2b9c239a7f9e7e127f52ab4b9e97763b0149.tar.gz nextcloud-server-eebe2b9c239a7f9e7e127f52ab4b9e97763b0149.zip |
User IUser::getEMailAddress() all over the place
Diffstat (limited to 'apps/encryption/lib/crypto')
-rw-r--r-- | apps/encryption/lib/crypto/encryptall.php | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/apps/encryption/lib/crypto/encryptall.php b/apps/encryption/lib/crypto/encryptall.php index 8e97fe341b4..ef67523d7e2 100644 --- a/apps/encryption/lib/crypto/encryptall.php +++ b/apps/encryption/lib/crypto/encryptall.php @@ -31,6 +31,7 @@ use OCP\IL10N; use OCP\IUserManager; use OCP\Mail\IMailer; use OCP\Security\ISecureRandom; +use OCP\Util; use Symfony\Component\Console\Helper\ProgressBar; use Symfony\Component\Console\Helper\QuestionHelper; use Symfony\Component\Console\Helper\Table; @@ -358,14 +359,15 @@ class EncryptAll { $progress = new ProgressBar($this->output, count($this->userPasswords)); $progress->start(); - foreach ($this->userPasswords as $recipient => $password) { + foreach ($this->userPasswords as $uid => $password) { $progress->advance(); if (!empty($password)) { - $recipientDisplayName = $this->userManager->get($recipient)->getDisplayName(); - $to = $this->config->getUserValue($recipient, 'settings', 'email', ''); + $recipient = $this->userManager->get($uid); + $recipientDisplayName = $recipient->getDisplayName(); + $to = $recipient->getEMailAddress(); if ($to === '') { - $noMail[] = $recipient; + $noMail[] = $uid; continue; } @@ -380,12 +382,12 @@ class EncryptAll { $message->setHtmlBody($htmlBody); $message->setPlainBody($textBody); $message->setFrom([ - \OCP\Util::getDefaultEmailAddress('admin-noreply') + Util::getDefaultEmailAddress('admin-noreply') ]); $this->mailer->send($message); } catch (\Exception $e) { - $noMail[] = $recipient; + $noMail[] = $uid; } } } |