Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/registration.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-07-14 18:01:57 +0300
committerJoas Schilling <coding@schilljs.com>2020-07-14 18:01:57 +0300
commit23408740ee9ab4d496d708ffe03fc132c7fcb28c (patch)
tree3c8dda69c5360e872e116e62c926dc0e06d41d6a /lib
parentfc0d42f30d0e85af288385c356ec52026dcb45ba (diff)
Fix variable names to use camelCase
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/Service/MailService.php29
1 files changed, 15 insertions, 14 deletions
diff --git a/lib/Service/MailService.php b/lib/Service/MailService.php
index 8993e84..5d8f581 100644
--- a/lib/Service/MailService.php
+++ b/lib/Service/MailService.php
@@ -119,29 +119,30 @@ class MailService {
public function notifyAdmins(string $userId, bool $userIsEnabled, string $userGroupId): void {
// Notify admin
- $admin_users = $this->groupManager->get('admin')->getUsers();
+ $adminUsers = $this->groupManager->get('admin')->getUsers();
// if the user is disabled and belongs to a group
// add subadmins of this group to notification list
if (!$userIsEnabled && $userGroupId) {
$group = $this->groupManager->get($userGroupId);
- $subadmin_users = $this->groupManager->getSubAdmin()->getGroupsSubAdmins($group);
- foreach ($subadmin_users as $user) {
- if (!in_array($user, $admin_users, true)) {
- $admin_users[] = $user;
+ $subAdmins = $this->groupManager->getSubAdmin()->getGroupsSubAdmins($group);
+ foreach ($subAdmins as $subAdmin) {
+ if (!in_array($subAdmin, $adminUsers, true)) {
+ $adminUsers[] = $subAdmin;
}
}
}
- $to_arr = [];
- foreach ($admin_users as $au) {
- $au_email = $au->getEMailAddress();
- if ($au_email && $au->isEnabled()) {
- $to_arr[$au_email] = $au->getDisplayName();
+ $toArr = [];
+ foreach ($adminUsers as $adminUser) {
+ $email = $adminUser->getEMailAddress();
+ if ($email && $adminUser->isEnabled()) {
+ $toArr[$email] = $adminUser->getDisplayName();
}
}
+
try {
- $this->sendNewUserNotifyEmail($to_arr, $userId, $userIsEnabled);
+ $this->sendNewUserNotifyEmail($toArr, $userId, $userIsEnabled);
} catch (\Exception $e) {
$this->logger->error('Sending admin notification email failed: '. $e->getMessage());
}
@@ -199,9 +200,9 @@ class MailService {
$message->setTo([]);
$message->setBcc($to);
$message->useTemplate($template);
- $failed_recipients = $this->mailer->send($message);
- if (!empty($failed_recipients)) {
- throw new RegistrationException('Failed recipients: '.print_r($failed_recipients, true));
+ $failedRecipients = $this->mailer->send($message);
+ if (!empty($failedRecipients)) {
+ throw new RegistrationException('Failed recipients: ' . print_r($failedRecipients, true));
}
}
}