Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
176 commits
Select commit Hold shift + click to select a range
5ff9d13
Add extension class to joomlaupdater
bembelimen Nov 16, 2024
d73c89a
Allow components to change config form
bembelimen Nov 16, 2024
4168ed1
Add extension class for joomlaupdater
bembelimen Nov 16, 2024
6f72404
Add needed config fields for automated updates
bembelimen Nov 16, 2024
0c30401
Add initial joomlaupdate webservice plugin
bembelimen Nov 16, 2024
6f1fc7c
Implement healthcheck API
bembelimen Nov 16, 2024
39d91f2
Move token check to header
bembelimen Nov 16, 2024
a8c8a3b
Update last health check date in extension table
bembelimen Nov 16, 2024
fe935e5
Implement token generation on config save
bembelimen Nov 16, 2024
102f6a5
Add deploy version
bembelimen Nov 16, 2024
5842280
Add joomlaupdate webservice plugin as core extension
bembelimen Nov 16, 2024
24c7e06
Add missing comment
bembelimen Nov 16, 2024
e0685ec
Fix comment
bembelimen Nov 16, 2024
63dc17e
Add type hint for model
bembelimen Nov 16, 2024
c3fca3e
Return error in health check when auto update is disabled
bembelimen Nov 17, 2024
4674f23
Move primary method to top in health check
bembelimen Nov 17, 2024
c782085
Implement getUpdate webservice call
bembelimen Nov 17, 2024
2a351f9
Make view call more generic
bembelimen Nov 17, 2024
59786d3
Remove unused code
bembelimen Nov 17, 2024
3183cfa
Rename parameter
bembelimen Nov 17, 2024
b3366c4
Update joomlaupdate config
bembelimen Nov 17, 2024
4810a62
Reimplement token generation
bembelimen Nov 17, 2024
dd3374e
Take care of minimum stability
bembelimen Nov 17, 2024
15079a2
Add restricter rule when auto updater is disabled
bembelimen Nov 17, 2024
b14e52e
Fix yntax error
bembelimen Nov 17, 2024
3c54684
Update getUpdate to use core functionality
bembelimen Nov 17, 2024
3755e78
Improve update disable information
bembelimen Nov 17, 2024
83d77b2
Fix notice
bembelimen Nov 17, 2024
2de0b41
Fix notice
bembelimen Nov 17, 2024
b25bba3
Correct ID
bembelimen Nov 17, 2024
e7f9938
Add prepareUpdate
bembelimen Nov 17, 2024
427c9b3
Add update finalization
bembelimen Nov 17, 2024
81158e4
Convert prepareUpdate and finalizeUpdate to POST
bembelimen Nov 17, 2024
a3f4f18
Fix code style
bembelimen Nov 17, 2024
6841fb9
Code style fix
bembelimen Nov 17, 2024
175423f
Implement update server registration.
Nov 17, 2024
1d04d45
Merge remote-tracking branch 'au/automated-updates/client' into autom…
Nov 17, 2024
344cce0
Update components/com_config/src/Service/Router.php
HLeithner Nov 18, 2024
529178e
Update libraries/src/Version.php
HLeithner Nov 18, 2024
e43fc86
Update libraries/src/Updater/ConstraintChecker.php
HLeithner Nov 18, 2024
dc84606
Update installation/src/Helper/DatabaseHelper.php
HLeithner Nov 18, 2024
5924f40
Update components/com_config/src/Service/Router.php
HLeithner Nov 18, 2024
5076bcf
Merge branch '5.3-dev' into automated-updates/client
bembelimen Jan 18, 2025
58dfbc9
Merge branch 'automated-updates/client' into automated-updates/register
bembelimen Jan 18, 2025
bb3be61
Implement quickicon
bembelimen Jan 18, 2025
e94ea6a
Merge pull request #3 from joomla-projects/automated-updates/dashboar…
SniperSister Jan 19, 2025
1a7ca04
Merge pull request #2 from joomla-projects/automated-updates/register
SniperSister Jan 19, 2025
a6e12e8
use correct site url
SniperSister Jan 20, 2025
7878039
fix input
SniperSister Jan 20, 2025
38df8cb
Merge remote-tracking branch 'upstream/5.3-dev' into automated-update…
Feb 22, 2025
2a9d4f0
Merge pull request #7 from joomla-projects/automated-updates/sync
HLeithner Feb 22, 2025
a05e1e3
Rework register
Feb 22, 2025
259ec81
Merge pull request #8 from joomla-projects/automated-updates/register…
SniperSister Mar 14, 2025
f2cbfc3
Add entry-point if-case for autoupdate extraction process
SniperSister Mar 14, 2025
2688ae9
Merge remote-tracking branch 'upstream/5.3-dev' into automated-update…
SniperSister Mar 14, 2025
5707f64
Update JoomlaupdateComponent.php
brianteeman Mar 14, 2025
210945d
Merge pull request #10 from brianteeman/patch-1
SniperSister Mar 14, 2025
206a28f
Added joomlaupdate webservice plugin to install and update SQL
SniperSister Mar 14, 2025
d05cad2
Merge branch 'automated-updates/client' of github.com:joomla-projects…
SniperSister Mar 14, 2025
022a3ac
Enhance guided tours for Joomla 5.3 with new automated updates featur…
bembelimen Mar 15, 2025
2b5517f
Refactor registration logic; move to model
SniperSister Mar 15, 2025
689454d
Merge pull request #11 from joomla-projects/automated-updates/client-…
SniperSister Mar 15, 2025
afff807
fix result
SniperSister Mar 15, 2025
7fd056b
Added acl check for autoupdate registration
SniperSister Mar 15, 2025
f1e6ae2
fix cast
SniperSister Mar 15, 2025
6372390
Fix acl check
SniperSister Mar 15, 2025
a262181
Merge pull request #12 from joomla-projects/feature/refactored-regist…
bembelimen Mar 15, 2025
6fca691
Add Postinstallation Message
Mar 15, 2025
dfe8c2c
Merge pull request #13 from joomla-projects/automated-updates/postmes…
SniperSister Mar 15, 2025
1ca5668
Update Postinstallation action
Mar 15, 2025
6106942
Merge pull request #14 from joomla-projects/automated-updates/postmes…
HLeithner Mar 15, 2025
3e6ef4e
fix copyright an subpackage
brianteeman Mar 15, 2025
7064fd0
Merge pull request #15 from brianteeman/patch-1
SniperSister Mar 15, 2025
a6cbb3f
Update com_joomlaupdate.ini
brianteeman Mar 15, 2025
1c3a28f
Merge pull request #16 from brianteeman/patch-2
SniperSister Mar 15, 2025
caa07f3
remove unused variable
SniperSister Mar 15, 2025
578d43e
fix default value for minimum_stability
SniperSister Mar 15, 2025
69eac5a
cs fix
SniperSister Mar 15, 2025
d3ab596
Prevent update notification emails when auto updater is active
bembelimen Mar 15, 2025
8cc4343
Merge pull request #20 from joomla-projects/automated-updates/disable…
SniperSister Mar 15, 2025
b9e3597
Call cleanup method and trigger actionlog
SniperSister Mar 15, 2025
3d04988
Merge pull request #21 from joomla-projects/feature/trigger-aciton-lo…
HLeithner Mar 15, 2025
809ce63
Adjust actionlog item for automated updates
SniperSister Mar 15, 2025
2623378
added tempaltes to initial dataset
SniperSister Mar 15, 2025
d1ce9e1
added update sqls
SniperSister Mar 15, 2025
07fd78c
Update administrator/language/en-GB/plg_actionlog_joomla.ini
SniperSister Mar 15, 2025
a1e339c
added mailtemplate texts
SniperSister Mar 15, 2025
20701fb
remove irrelevant change
SniperSister Mar 15, 2025
2ab51cd
cs fixes
SniperSister Mar 15, 2025
7f67288
re-add defines path
SniperSister Mar 15, 2025
741798a
Merge pull request #22 from joomla-projects/feature/actionlog-item-fixes
SniperSister Mar 15, 2025
2dba4e8
added quickicon to extension helper
SniperSister Mar 15, 2025
4d7faba
remove unused check
SniperSister Mar 15, 2025
9e1a412
cs fix
SniperSister Mar 15, 2025
8bd2e3c
Merge branch 'automated-updates/client' of github.com:joomla-projects…
SniperSister Mar 15, 2025
542b97c
fix js codestyles
SniperSister Mar 15, 2025
1b1af9d
Apply suggestions from code review
bembelimen Mar 15, 2025
991cf2c
Update administrator/components/com_joomlaupdate/config.xml
bembelimen Mar 15, 2025
f7454b4
Update notification
Mar 15, 2025
d2c48fc
Merge branch 'automated-updates/client' into feature/info-mails
HLeithner Mar 15, 2025
582016d
Rename auto update => automated update
bembelimen Mar 15, 2025
d13e362
Automated update => automated updates
bembelimen Mar 15, 2025
730b0ae
Fixed notification
Mar 15, 2025
5a7de0d
Fixed notification
Mar 15, 2025
5e963e1
Merge branch '5.4-dev' into automated-updates/client
richard67 Mar 16, 2025
ecc2814
Rename update SQL scripts
richard67 Mar 16, 2025
892fef3
Revert guided tours update SQL changes
richard67 Mar 16, 2025
101735b
Move image for guided tours to 5.4
richard67 Mar 16, 2025
92017a7
Revert guided tours 5.3 language file changes
richard67 Mar 16, 2025
7c80d91
Change postinstall message condition to 5.4.0
richard67 Mar 16, 2025
f2da310
Change postinstall message to 5.4
richard67 Mar 16, 2025
afe3853
Add guided tours what's new in 5.4
richard67 Mar 16, 2025
299386e
Merge pull request #3 from richard67/5.4-dev-automated-updates-client…
SniperSister Mar 16, 2025
04c27fd
Apply suggestions from code review
richard67 Mar 16, 2025
291970e
Merge pull request #23 from joomla-projects/feature/info-mails
SniperSister Mar 17, 2025
a5c05ea
Merge remote-tracking branch 'my-origin/automated-updates/client' int…
SniperSister Apr 21, 2025
88a3093
implement code review suggestions
SniperSister Apr 21, 2025
a1ba665
Added CLI commands for registration and unregistraoitn
SniperSister Apr 21, 2025
d1274c9
Update libraries/src/Console/AutomatedUpdatesUnregisterCommand.php
SniperSister Apr 21, 2025
dcfd1ac
Update libraries/src/Console/AutomatedUpdatesRegisterCommand.php
SniperSister Apr 21, 2025
759d684
Update libraries/src/Console/AutomatedUpdatesUnregisterCommand.php
SniperSister Apr 21, 2025
7b77717
Merge pull request #26 from joomla-projects/automated-updates/cli-com…
HLeithner Apr 24, 2025
5ee6a48
cs fix
SniperSister May 9, 2025
78d3bc1
cs fix
SniperSister May 9, 2025
29c39af
Update administrator/language/en-GB/com_joomlaupdate.ini
HLeithner May 10, 2025
f15b477
Update api/components/com_joomlaupdate/src/View/Healthcheck/JsonapiVi…
HLeithner May 10, 2025
69dc3c6
Update api/components/com_joomlaupdate/src/View/Notification/JsonapiV…
HLeithner May 10, 2025
d03134f
Combine sql update files
HLeithner May 10, 2025
d4925d8
Fix ordering of webservices plugins
richard67 May 10, 2025
ee5d8e7
Merge pull request #4 from richard67/5.4-dev-automated-updates-client…
SniperSister May 10, 2025
7a9c27c
adjust string sorting
SniperSister May 10, 2025
55b3464
Apply suggestions from code review
SniperSister May 10, 2025
c98594e
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister May 10, 2025
d207189
Merge branch '5.4-dev' into automated-updates/client
richard67 May 10, 2025
7646135
fix missing import
SniperSister May 10, 2025
1fa7841
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister May 10, 2025
cf6b506
Merge branch '5.4-dev' into automated-updates/client
richard67 May 10, 2025
6451720
update i18n strings
SniperSister May 13, 2025
e01fdc3
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister May 13, 2025
fe3e930
fix notification subjects
SniperSister May 13, 2025
91499d6
Quickicon Link
brianteeman May 13, 2025
1c4f61c
Merge pull request #27 from brianteeman/patch-1
SniperSister May 13, 2025
58c39e6
Update plg_quickicon_autoupdate.ini
brianteeman May 13, 2025
f455e3e
Merge pull request #28 from brianteeman/patch-2
SniperSister May 13, 2025
03aa9fd
Added mail template i18n strings
SniperSister May 13, 2025
c32ae03
Update administrator/language/en-GB/com_joomlaupdate.ini
SniperSister May 13, 2025
ec9a66e
Apply suggestions from code review
SniperSister May 13, 2025
bf67c6f
Merge pull request #30 from joomla-projects/automated-updates/mailtem…
SniperSister May 13, 2025
9bcf681
Merge branch '5.4-dev' into automated-updates/client
richard67 May 13, 2025
458a762
Apply suggestions from code review
SniperSister May 14, 2025
8d50a2c
Fix docblock
SniperSister May 14, 2025
43754f1
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister May 14, 2025
75ed12b
fix site url
SniperSister May 14, 2025
d449d0c
Fix PHPCS
richard67 May 14, 2025
bce0f6d
automated_updates_email
brianteeman May 14, 2025
fd7f913
Update com_joomlaupdate.ini
brianteeman May 14, 2025
11fd40a
Merge pull request #35 from brianteeman/patch-2
HLeithner May 14, 2025
3c732b3
Update com_joomlaupdate.ini
brianteeman May 15, 2025
121d6f9
Merge pull request #36 from brianteeman/patch-2
SniperSister May 15, 2025
9f5f470
Merge pull request #33 from brianteeman/patch-1
SniperSister May 15, 2025
de1e671
Merge branch 'automated-updates/client' of https://github.com/SniperS…
SniperSister May 15, 2025
ddff7f1
Check stability and channel in quickicon status output
SniperSister May 15, 2025
557e7eb
respect user time in last_check-Date
SniperSister May 15, 2025
17316d0
Update NotificationModel.php
brianteeman May 15, 2025
eb72e9b
Merge pull request #37 from brianteeman/patch-1
SniperSister May 15, 2025
b148bd9
Update guidedtours.joomla_whatsnew_5_4.ini
brianteeman May 15, 2025
8a25b3f
Merge pull request #38 from brianteeman/patch-1
SniperSister May 15, 2025
6ff5187
cs fix
SniperSister May 15, 2025
a339bc2
cs fix
SniperSister May 15, 2025
c04e654
check update requirements in healthcheck and get update endpoints
SniperSister May 18, 2025
654e01d
add cache purger
SniperSister May 18, 2025
dac1d43
cs fix
SniperSister May 18, 2025
d169a35
fix email
SniperSister May 19, 2025
de781d9
fix default config state
SniperSister May 19, 2025
933b70f
Merge branch '5.4-dev' into automated-updates/client
muhme May 20, 2025
e10528f
Merge branch '5.4-dev' into automated-updates/client
richard67 May 20, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`)
SELECT 0, 'plg_quickicon_autoupdate', 'plugin', 'autoupdate', 'quickicon', 0, 1, 1, 0, 1, '', '', '', -1, 0
WHERE NOT EXISTS (SELECT * FROM `#__extensions` e WHERE e.`type` = 'plugin' AND e.`element` = 'autoupdate' AND e.`folder` = 'quickicon' AND e.`client_id` = 0);

INSERT INTO `#__extensions` (`package_id`, `name`, `type`, `element`, `folder`, `client_id`, `enabled`, `access`, `protected`, `locked`, `manifest_cache`, `params`, `custom_data`, `ordering`, `state`)
SELECT 0, 'plg_webservices_joomlaupdate', 'plugin', 'joomlaupdate', 'webservices', 0, 1, 1, 0, 1, '', '', '', -1, 0
WHERE NOT EXISTS (SELECT * FROM `#__extensions` e WHERE e.`type` = 'plugin' AND e.`element` = 'joomlaupdate' AND e.`folder` = 'webservices' AND e.`client_id` = 0);

INSERT INTO `#__mail_templates` (`template_id`, `extension`, `language`, `subject`, `body`, `htmlbody`, `attachments`, `params`) VALUES
('com_joomlaupdate.update.success', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}'),
('com_joomlaupdate.update.failed', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}');

-- add post-installation message for automated updates
INSERT INTO `#__postinstall_messages` (`extension_id`, `title_key`, `description_key`, `action_key`, `language_extension`, `language_client_id`, `type`, `action_file`, `action`, `condition_file`, `condition_method`, `version_introduced`, `enabled`)
SELECT `extension_id`, 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_TITLE', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_DESCRIPTION', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_ACTION', 'com_joomlaupdate', 1, 'action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_condition', '5.4.0', 1 FROM `#__extensions` WHERE `name` = 'files_joomla';

-- disable autostart for the previous tour
UPDATE `#__guidedtours` SET `autostart` = 0 WHERE `uid` = 'joomla-whatsnew-5-3';

INSERT INTO `#__guidedtours` (`title`, `description`, `extensions`, `url`, `published`, `language`, `note`, `access`, `uid`, `autostart`, `created`, `created_by`, `modified`, `modified_by`) VALUES
('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-4', 1, CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0);

INSERT INTO `#__guidedtour_steps` (`title`, `description`, `position`, `target`, `type`, `interactive_type`, `url`, `published`, `language`, `note`, `params`, `tour_id`, `created`, `created_by`, `modified`, `modified_by`)
SELECT 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '"{\"required\":1,\"requiredvalue\":\"\"}"', MAX(`id`), CURRENT_TIMESTAMP(), 0, CURRENT_TIMESTAMP(), 0
FROM `#__guidedtours`
WHERE `uid` = 'joomla-whatsnew-5-4';
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state")
SELECT 0, 'plg_quickicon_autoupdate', 'plugin', 'autoupdate', 'quickicon', 0, 1, 1, 0, 1, '', '', '', -1, 0
WHERE NOT EXISTS (SELECT * FROM "#__extensions" e WHERE e."type" = 'plugin' AND e."element" = 'autoupdate' AND e."folder" = 'quickicon' AND e."client_id" = 0);

INSERT INTO "#__extensions" ("package_id", "name", "type", "element", "folder", "client_id", "enabled", "access", "protected", "locked", "manifest_cache", "params", "custom_data", "ordering", "state")
SELECT 0, 'plg_webservices_joomlaupdate', 'plugin', 'joomlaupdate', 'webservices', 0, 1, 1, 0, 1, '', '', '', -1, 0
WHERE NOT EXISTS (SELECT * FROM "#__extensions" e WHERE e."type" = 'plugin' AND e."element" = 'joomlaupdate' AND e."folder" = 'webservices' AND e."client_id" = 0);

INSERT INTO "#__mail_templates" ("template_id", "extension", "language", "subject", "body", "htmlbody", "attachments", "params") VALUES
('com_joomlaupdate.update.success', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_SUCCESS_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}'),
('com_joomlaupdate.update.failed', 'com_joomlaupdate', '', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_SUBJECT', 'COM_JOOMLAUPDATE_UPDATE_FAILED_MAIL_BODY', '', '', '{"tags":["newversion","oldversion","sitename","url"]}');

-- add post-installation message for automated updates
INSERT INTO "#__postinstall_messages" ("extension_id", "title_key", "description_key", "action_key", "language_extension", "language_client_id", "type", "action_file", "action", "condition_file", "condition_method", "version_introduced", "enabled")
SELECT "extension_id", 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_TITLE', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_DESCRIPTION', 'COM_JOOMLAUPDATE_POSTINSTALL_MSG_AUTOMATED_UPDATES_ACTION', 'com_joomlaupdate', 1, 'action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_action', 'admin://components/com_joomlaupdate/postinstall/autoupdate.php', 'com_joomlaupdate_postinstall_autoupdate_condition', '5.4.0', 1 FROM "#__extensions" WHERE "name" = 'files_joomla';

-- disable autostart for the previous tour
UPDATE "#__guidedtours" SET "autostart" = 0 WHERE "uid" = 'joomla-whatsnew-5-3';

INSERT INTO "#__guidedtours" ("title", "description", "extensions", "url", "published", "language", "note", "access", "uid", "autostart", "created", "created_by", "modified", "modified_by") VALUES
('COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_DESCRIPTION', '["com_cpanel"]', 'administrator/index.php', 1, '*', '', 1, 'joomla-whatsnew-5-4', 1, CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0);

INSERT INTO "#__guidedtour_steps" ("title", "description", "position", "target", "type", "interactive_type", "url", "published", "language", "note", "params", "tour_id", "created", "created_by", "modified", "modified_by")
SELECT 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_TITLE', 'COM_GUIDEDTOURS_TOUR_WHATSNEW_5_4_STEP_0_DESCRIPTION', 'right', '#sidebarmenu nav > ul:first-of-type > li:last-child', 0, 1, '', 1, '*', '', '"{\"required\":1,\"requiredvalue\":\"\"}"', MAX("id"), CURRENT_TIMESTAMP, 0, CURRENT_TIMESTAMP, 0
FROM "#__guidedtours"
WHERE "uid" = 'joomla-whatsnew-5-4';
56 changes: 56 additions & 0 deletions administrator/components/com_joomlaupdate/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,60 @@
</field>

</fieldset>
<fieldset
name="automated-updates"
label="COM_JOOMLAUPDATE_CONFIG_AUTOMATED_UPDATES_LABEL"
>
<field
name="autoupdate"
type="radio"
label="COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_LABEL"
description="COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_DESC"
default="0"
layout="joomla.form.field.radio.switcher"
showon="updatesource:default[AND]minimum_stability:4"
validate="options"
>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>

<field
name="autoupdate_status"
type="hidden"
/>

<field
name="update_token"
type="text"
label="COM_JOOMLAUPDATE_CONFIG_UPDATE_TOKEN_LABEL"
description="COM_JOOMLAUPDATE_CONFIG_UPDATE_TOKEN_DESC"
readonly="true"
showon="updatesource:default[AND]minimum_stability:4[AND]autoupdate:1"
/>
<field
name="update_last_check"
type="calendar"
showtime="true"
filter="user_utc"
label="COM_JOOMLAUPDATE_CONFIG_UPDATE_LAST_CHECK_LABEL"
description="COM_JOOMLAUPDATE_CONFIG_UPDATE_LAST_CHECK_DESC"
readonly="true"
showon="updatesource:default[AND]minimum_stability:4[AND]autoupdate:1"
/>
<field
name="automated_updates_disabled"
type="note"
label="COM_JOOMLAUPDATE_CONFIG_AUTOMATED_UPDATES_DISABLED_LABEL"
class="alert alert-info w-100"
showon="updatesource!:default[OR]minimum_stability!:4"
/>
<field
name="automated_updates_email"
type="text"
label="COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_LABEL"
description="COM_JOOMLAUPDATE_CONFIG_AUTOUPDATE_UPDATE_EMAIL_DESCRIPTION"
showon="updatesource:default[AND]minimum_stability:4[AND]autoupdate:1"
/>
</fieldset>
</config>
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_joomlaupdate
*
* @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Table\Extension;
use Joomla\Component\Joomlaupdate\Administrator\Enum\AutoupdateRegisterState;
use Joomla\Component\Joomlaupdate\Administrator\Enum\AutoupdateState;
use Joomla\Database\DatabaseInterface;
use Joomla\Registry\Registry;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Post-installation message about the new Automated Update: condition check.
*
* Returns true it is disabled.
*
* @return bool
* @since __DEPLOY_VERSION__
*/
function com_joomlaupdate_postinstall_autoupdate_condition(): bool
{
return AutoupdateState::tryFrom(ComponentHelper::getParams('com_joomlaupdate')->get('autoupdate', '0')) === AutoupdateState::Disabled;
}

/**
* Post-installation message about the new Automated Update: action.
*
* Enables the Automated Update.
*
* @return void
* @since __DEPLOY_VERSION__
*/
function com_joomlaupdate_postinstall_autoupdate_action(): void
{
$db = Factory::getContainer()->get(DatabaseInterface::class);

// Get extension row
$extension = new Extension($db);
$extensionId = $extension->find(['element' => 'com_joomlaupdate']);
$extension->load($extensionId);

// Set new update registration state
$params = new Registry($extension->params);
$params->set('autoupdate', AutoupdateState::Enabled);
$params->set('autoupdate_status', AutoupdateRegisterState::Subscribe);

$extension->params = $params->toString();

if (!$extension->store()) {
throw new \RuntimeException($extension->getError());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@

namespace Joomla\Component\Joomlaupdate\Administrator\Controller;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Installer\Installer;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Log\Log;
use Joomla\CMS\MVC\Controller\BaseController;
use Joomla\CMS\Response\JsonResponse;
use Joomla\CMS\Session\Session;
use Joomla\CMS\Updater\Updater;
use Joomla\Component\Joomlaupdate\Administrator\Enum\AutoupdateRegisterState;
use Joomla\Component\Joomlaupdate\Administrator\Model\UpdateModel;

// phpcs:disable PSR1.Files.SideEffects
Expand Down Expand Up @@ -712,4 +715,60 @@ public function ajax()

$this->app->close();
}

/**
* Fetch and report health status of the automated updates in \JSON format, for AJAX requests
*
* @return void
*
* @since __DEPLOY_VERSION__
*/
public function healthstatus()
{
if (!Session::checkToken('get')) {
$this->app->setHeader('status', 403, true);
$this->app->sendHeaders();
echo Text::_('JINVALID_TOKEN_NOTICE');
$this->app->close();
}

$params = ComponentHelper::getParams('com_joomlaupdate');

// Edge case: the current state requires the registration, i.e. because it's a new installation
$registrationState = AutoupdateRegisterState::tryFrom($params->get('autoupdate_status', 0));

if (
$this->app->getIdentity()->authorise('core.admin', 'com_joomlaupdate')
&& $registrationState === AutoupdateRegisterState::Subscribe
) {
/** @var UpdateModel $model */
$model = $this->getModel('Update');
$result = $model->changeAutoUpdateRegistration($registrationState);

$result = [
'active' => true,
'healthy' => $result,
];

echo json_encode($result);

$this->app->close();
}

// Default case: connection already configured, check update source and date
$lastCheck = date_create_from_format('Y-m-d H:i:s', $params->get('update_last_check', ''));

$result = [
'active' => (
(int) $params->get('autoupdate')
&& $params->get('updatesource', 'default') === 'default'
&& (int) $params->get('minimum_stability', Updater::STABILITY_STABLE) === Updater::STABILITY_STABLE
),
'healthy' => $lastCheck !== false && $lastCheck->diff(new \DateTime())->days < 4,
];

echo json_encode($result);

$this->app->close();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_joomlaupdate
*
* @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Joomlaupdate\Administrator\Enum;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Autoupdate State Enum
*/
enum AutoupdateRegisterState: int
{
case Unsubscribe = -1;
case Unsubscribed = 0;
case Subscribe = 1;
case Subscribed = 2;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php

/**
* @package Joomla.Administrator
* @subpackage com_joomlaupdate
*
* @copyright (C) 2025 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/

namespace Joomla\Component\Joomlaupdate\Administrator\Enum;

// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects

/**
* Autoupdate State Enum
*/
enum AutoupdateState: int
{
case Disabled = 0;
case Enabled = 1;
}
Loading