Several times now i have had moderaters argue about who did what regarding members. So i came up with a very basic format.
Disclaimer: Yes this works but it is very basic, for now it only works when you delete a member. I have not yet found a general place where i can build a function to pass all user events through. So for now i will just have to pick and choose which events i want to record and post this code in that event function.
So there are lots of things on the todo list for now, but again i have tested this for the delete user option from userside member display and it works.
My plan is to add it to all of the following events userside and admin side:
delete user,
approve,
suspend,
check IP (ip tracker plugin) this will confirm that moderators checked the ip,
change role,
change password,
delete another users content (image, video, forum post, etc.. )
and that is a good start... I hope that Oxwall comes out with something in the next version or so for this. You have a ox_logs dir but nothing in there.
Also if anyone wants to help please do...
So far this is what i have that works...
This works for delete user only for now..
1. create a text file in ow_logs named modlog.txt with permissions at least 666
2. edit ow_system_plugins/base/bol/user_service.php
find this code (about line 671)
public function deleteUser( $userId, $deleteContent = false )
{
and add AFTER the { this code
// added for modlog
//get date
$logdate = date('Y-m-d');
$logtime = time();
//get user displayname of the user being deleted
$logusername = $this->getDisplayName($userId);
//get moderator name of the mod doing the delete
// TODO need to pass the moderator user id here from the initiating file in order to post the mod info here rather than admin
$moduser = 'admin';
//set the name of the log file and location
$modlogfile = 'ow_logs/modlog.txt';
// Lets make sure the file exists and is writable first
if (is_writable($modlogfile))
{
// The data to add to the file
$logdata = $logusername. "-" . $userId . " was deleted by ". $moduser . " on " . $logdate . " at " . $logtime . "\n";
//update log file
file_put_contents($modlogfile, $logdata, FILE_APPEND | LOCK_EX);
}else{
// TODO create a else error process here, since the process is running of a inline confirm alert, not sure we can just say return or not
//cannot get the else to work regarding display of message or return false
// throw new InvalidArgumentException('Log File Failure - user not deleted!');
// return false;
}
// end of add
make sure the origional delete process for this function is here in this area
then save the file
here is the sample of the contents of the text file..
Geert-10 was deleted by admin on 2013-12-13 at 1386936743
If you would like to help please lets figure out the error display first, i was not able to get that to work correctly if the file is not writable.