summaryrefslogtreecommitdiffstats
path: root/apps/encryption/lib/crypto
diff options
context:
space:
mode:
Diffstat (limited to 'apps/encryption/lib/crypto')
-rw-r--r--apps/encryption/lib/crypto/encryptall.php14
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;
}
}
}