SMF Development > Applied or Declined Requests

Package installation/uninstallation should be logged in admin log

(1/2) > >>

Arantor:
2.0 includes the administration log, of which various admin items are logged. Oddly, though, package installation/uninstallation isn't logged.

I'd like to see it included, it's only two edits actually required to achieve it, too. Package and instructions for 2.0 RC3.

The first is an edit to Packages.php to actually log the event.

Find:

--- Code: --- // Clean house... get rid of the evidence ;).
--- End code ---

Before it, add:

--- Code: --- // Log this in the admin log.
logAction(
$context['uninstalling'] ? 'uninstall_package' : (!empty($is_upgrade) ? 'upgrade_package' : 'install_package'),
array(
'package' => $smcFunc['htmlspecialchars']($packageInfo['name']),
'version' => $smcFunc['htmlspecialchars']($packageInfo['version']),
),
'admin'
);
--- End code ---

As far as I remember it should be sanitised by $smcFunc['htmlspecialchars'] because what's in the name is normally raw characters.

Then it's an edit to Modlog.english.php (the package does it for Modifications.english.php so it will always be loaded even on non English forums without the string translated, but if it's adopted officially it should be put into Modlog)

Just to the end of the file:

--- Code: ---$txt['modlog_ac_install_package'] = 'Installed new package: "{package}", version {version}';
$txt['modlog_ac_upgrade_package'] = 'Upgraded package: "{package}" to version {version}';
$txt['modlog_ac_uninstall_package'] = 'Uninstalled package: "{package}", version {version}';
--- End code ---


I'd argue it should be included in 2.0 RC4/final/whatever because IMO it's not a new feature, it's completing an existing one.

MultiformeIngegno:
Totally agree! 8)

Arantor:
Well, this was requested as a feature of SimpleDesk, to announce itself to the log but it made more sense to be out of SimpleDesk and in SMF generally.

In case anyone's wondering what the result would be:

Runic:
this be good idea, will help people know what was the last mod installed (if they have poor memory) and will make support easier

Arantor:
Something like Sortable Packages (and Installed Time) helps with that too, but yeah.

Navigation

[0] Message Index

[#] Next page

Go to full version