Currently, if the recording of IP address is enabled, the IP address is recorded in the the table #_action_logs. However, it is not possible to select IP address from the list under the heading Insert Tags in User Actions Log: Notification Mail at aadministrator/index.php?option=com_mails&view=template&layout=edit&template_id=com_actionlogs.notification&language=en-GB
IP address available for selection when editing the mail template User Actions Log: Notification Mail, "Mail sent to administrators about new entries in the User Actions Log."
IP address is not available under the heading Insert Tags.
Tested in Joomla 4.2.5-dev
Forum discussion with a proof-of-concept (POC) process and a copy of a test version of administrator/components/com_actionlogs/src/Model/ActionlogModel.php with three modifications at https://forum.joomla.org/viewtopic.php?f=813&t=997604
Update: as @SharkyKZ pointed out in the forum discussion, only the last change is required. If IP addresses are enabled, $message already contains the IP address and only the following addition is required, if a new tag 'ipaddress' has been added to the params column of the mail template:
$m['ipaddress'] = $message->ip_address;
Labels |
Removed:
?
|
Labels |
Added:
No Code Attached Yet
|
The question is: Why?
Even the storage of IP addresses is in most cases a violation of data protection law. So why a feature that is actually largely avoided in Joomla for good reasons?
Sending IP addresses together with user names by email?
I would very much welcome this feature. I use these action log email notifications to see if someone other than me is trying to login to the administrator section of a joomla web site. Without the ip address included in the email these notifications are much less useful. IP Address inclusion can be disabled by default, but it would be great to be able to turn that on for those like me who would like to.
Hm. When I get an action log email I know that I'm not logged in or am logged in at that moment ;-) I seldomely know my own IP. I don't know what it helps to know the IP of a bad guy that logged in while I was sleeping.
If other users change something permissibly, then the IP is of no help in most cases because I do not know their IP at all and therefore cannot use it to check.
IP Address inclusion can be disabled by default, but it would be great to be able to turn that on for those like me who would like to.
But this requires further programming effort. Personally, I doubt it's worth the effort, but it's not for me to decide. I just don't like unnecessary, irritating settings that might rarely be needed.
If you have enabled IP and added the {IP}-tag to your template and then you disable the feature what will happen with the tag? Leave it unresolved in the template? Or add additional PHP code to remove it without resolving it or ... ?
In my case, I don't always look at the action log emails right away. A few hours later, I find it easiest to spot unwanted login attempts using the ip address. I know my own ip address, so I can easily spot anything other than my own ip address.
As for your last question, what happens if ip address tag is added to the email template and then ip logging is disabled, I'd say anything other than crashing the site should be fine; leave the tag unresolved, leave it blank, say ip address not logged... whatever is easiest.
Labels |
Added:
?
|
A sample ActionLog.php from POC - administrator/components/com_actionlogs/src/Model/ActionlogModel.php
ActionlogModel.php.txt
This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39190.