Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public function download()
public function install()
{
$this->checkToken('get');
JFactory::getApplication()->setUserState('com_joomlaupdate.oldversion', JVERSION);

$options['format'] = '{DATE}\t{TIME}\t{LEVEL}\t{CODE}\t{MESSAGE}';
$options['text_file'] = 'joomla_update.php';
Expand Down
4 changes: 3 additions & 1 deletion administrator/components/com_joomlaupdate/models/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -922,9 +922,11 @@ public function cleanUp()

// Unset the update filename from the session.
JFactory::getApplication()->setUserState('com_joomlaupdate.file', null);
$oldVersion = JFactory::getApplication()->getUserState('com_joomlaupdate.oldversion');

// Trigger event after joomla update.
JFactory::getApplication()->triggerEvent('onJoomlaAfterUpdate');
JFactory::getApplication()->triggerEvent('onJoomlaAfterUpdate', array($oldVersion));
JFactory::getApplication()->setUserState('com_joomlaupdate.oldversion', null);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ PLG_ACTIONLOG_JOOMLA_USER_REGISTERED="User <a href='{accountlink}'>{username}</a
PLG_ACTIONLOG_JOOMLA_USER_REMIND="User <a href='{accountlink}'>{username}</a> requested a username reminder for their account"
PLG_ACTIONLOG_JOOMLA_USER_RESET_COMPLETE="User <a href='{accountlink}'>{username}</a> completed the password reset for their account"
PLG_ACTIONLOG_JOOMLA_USER_RESET_REQUEST="User <a href='{accountlink}'>{username}</a> requested a password reset for their account"
PLG_ACTIONLOG_JOOMLA_USER_UPDATE="User <a href='{accountlink}'>{username}</a> updated Joomla to {version}"
PLG_ACTIONLOG_JOOMLA_USER_UPDATE="User <a href='{accountlink}'>{username}</a> updated Joomla from {oldversion} to {version}"
; Component
PLG_ACTIONLOG_JOOMLA_APPLICATION_CONFIG_UPDATED="User <a href='{accountlink}'>{username}</a> changed settings of the application configuration"
PLG_ACTIONLOG_JOOMLA_COMPONENT_CONFIG_UPDATED="User <a href='{accountlink}'>{username}</a> changed settings of the component {extension_name}"
Expand Down
11 changes: 10 additions & 1 deletion plugins/actionlog/joomla/joomla.php
Original file line number Diff line number Diff line change
Expand Up @@ -1049,14 +1049,22 @@ public function onAfterPurge($group = 'all')
*
* Method is called after user update the CMS.
*
* @param string $oldVersion The Joomla version before the update
*
* @return void
*
* @since 3.9.21
*/
public function onJoomlaAfterUpdate()
public function onJoomlaAfterUpdate($oldVersion = null)
{
$context = $this->app->input->get('option');
$user = JFactory::getUser();

if (empty($oldVersion))
{
$oldVersion = JText::_('JLIB_UNKNOWN');
}

$message = array(
'action' => 'joomlaupdate',
'type' => 'PLG_ACTIONLOG_JOOMLA_TYPE_USER',
Expand All @@ -1067,6 +1075,7 @@ public function onJoomlaAfterUpdate()
'username' => $user->username,
'accountlink' => 'index.php?option=com_users&task=user.edit&id=' . $user->id,
'version' => JVERSION,
'oldversion' => $oldVersion,
);
$this->addLog(array($message), 'PLG_ACTIONLOG_JOOMLA_USER_UPDATE', $context, $user->id);
}
Expand Down