Skip to content

Commit 047cdcf

Browse files
committed
Remove field notification emails from autoupdate
1 parent 89502fd commit 047cdcf

File tree

3 files changed

+4
-46
lines changed

3 files changed

+4
-46
lines changed

administrator/components/com_joomlaupdate/config.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,5 @@
121121
class="alert alert-info w-100"
122122
showon="updatesource!:default[OR]minimum_stability!:4"
123123
/>
124-
<field
125-
name="automated_updates_email"
126-
type="text"
127-
label="COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_LABEL"
128-
description="COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_DESCRIPTION"
129-
showon="updatesource:default[AND]minimum_stability:4[AND]autoupdate:1"
130-
/>
131124
</fieldset>
132125
</config>

administrator/components/com_joomlaupdate/src/Model/NotificationModel.php

Lines changed: 4 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
use Joomla\CMS\Table\Asset;
2020
use Joomla\CMS\Uri\Uri;
2121
use Joomla\CMS\Version;
22-
use Joomla\Database\ParameterType;
2322
use Joomla\Registry\Registry;
2423

2524
// phpcs:disable PSR1.Files.SideEffects
@@ -48,19 +47,8 @@ public function sendNotification($type, $oldVersion): void
4847
{
4948
$params = ComponentHelper::getParams('com_joomlaupdate');
5049

51-
// Load the parameters.
52-
$specificEmail = $params->get('automated_updates_email');
53-
54-
// Let's find out the email addresses to notify
55-
$superUsers = [];
56-
57-
if (!empty($specificEmail)) {
58-
$superUsers = $this->getSuperUsers($specificEmail);
59-
}
60-
61-
if (empty($superUsers)) {
62-
$superUsers = $this->getSuperUsers();
63-
}
50+
// Send a notification to all super users
51+
$superUsers = $this->getSuperUsers();
6452

6553
if (empty($superUsers)) {
6654
throw new \RuntimeException();
@@ -105,22 +93,6 @@ public function sendNotification($type, $oldVersion): void
10593
private function getSuperUsers($email = null): array
10694
{
10795
$db = $this->getDatabase();
108-
$emails = [];
109-
110-
// Convert the email list to an array
111-
if (!empty($email)) {
112-
$temp = explode(',', $email);
113-
114-
foreach ($temp as $entry) {
115-
if (!MailHelper::isEmailAddress(trim($entry))) {
116-
continue;
117-
}
118-
119-
$emails[] = trim($entry);
120-
}
121-
122-
$emails = array_unique($emails);
123-
}
12496

12597
// Get a list of groups which have Super User privileges
12698
$ret = [];
@@ -144,10 +116,10 @@ private function getSuperUsers($email = null): array
144116
if (empty($groups)) {
145117
return $ret;
146118
}
147-
} catch (\Exception $exc) {
119+
} catch (\Exception $exc) {
148120
return $ret;
149121
}
150-
122+
151123
// Get the user IDs of users belonging to the SA groups
152124
try {
153125
$query = $db->getQuery(true)
@@ -174,11 +146,6 @@ private function getSuperUsers($email = null): array
174146
->where($db->quoteName('block') . ' = 0')
175147
->where($db->quoteName('sendEmail') . ' = 1');
176148

177-
if (!empty($emails)) {
178-
$lowerCaseEmails = array_map('strtolower', $emails);
179-
$query->whereIn('LOWER(' . $db->quoteName('email') . ')', $lowerCaseEmails, ParameterType::STRING);
180-
}
181-
182149
$ret = $db->setQuery($query)->loadObjectList();
183150
} catch (\Exception) {
184151
return $ret;

administrator/language/en-GB/com_joomlaupdate.ini

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ COM_JOOMLAUPDATE_CONFIG_AUTOMATED_UPDATES_DISABLED_LABEL="<span class=\"fa-fw me
1616
COM_JOOMLAUPDATE_CONFIG_AUTOMATED_UPDATES_LABEL="Automated Updates"
1717
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_DESC="Automatically update Joomla to the latest version when it is available."
1818
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_LABEL="Automated Update"
19-
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_DESCRIPTION="A comma separated list of the email addresses which will receive the update notification emails. The addresses in the list MUST belong to existing users of your site who have the Super User privilege. If none of the listed emails belongs to Super Users, or if it's left blank, all Super Users of this site will receive the update notification email."
20-
COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_LABEL="Super User Emails"
2119
COM_JOOMLAUPDATE_CONFIG_BACKUPCHECK_DESC="Shows the checkbox to confirm you have taken a backup and you're ready to update in the final step before the update is actually applied."
2220
COM_JOOMLAUPDATE_CONFIG_BACKUPCHECK_LABEL="Confirm Backup Checkbox"
2321
COM_JOOMLAUPDATE_CONFIG_CUSTOMURL_LABEL="Custom URL"

0 commit comments

Comments
 (0)