Last modified: 2011-11-17 00:45:34 UTC
Created attachment 7579 [details]
implementation of $wgLogFormatters
$wgLogActions does not provide for a lot of fine-grained control over log entries; I wrote an extension to log failed login attempts to our wiki, which involved displaying entries for non-existent users. I ended up implementing something which let me intercept the individual entries before they were displayed. Attached are the changes I made against 1.15.3.
*Bulk BZ Change: +Patch to open bugs with patches attached that are missing the keyword*
Michael, thank you for your patch, and my apologies that it's gone so long without a response. I'm adding the "need-review" keyword to signal that someone should review your patch. If you have the time and the interest, could you rebase it against current MediaWiki trunk in Subversion? Thanks!
Although minor (and would be easy to fix), this patch has register_globals issues, as the variable is not defined in DefaultSettings.php setting it to an empty array
!empty should become isset too
Using a global to store functions seems a bit icky, wouldn't this possibly make more sense as a hook?
I'll defer to any suggestions regarding ickiness, as I'm certainly not that experienced working with the Mediawiki code.
It's been a while so I don't recall why I did it this way, but my notes say that this implementation is "same as $wgLogActions or $wgHooks" so I believe I was just copying some existing code.
Created attachment 9450 [details]
updated patch for 1.17.0
For what it's worth, here's the patch updated to 1.17.0 code, with the above mentioned issues addressed. I don't have a trunk setup at the moment.
You can already do quite a lot of customization with $wgLogActionsHandlers. I'm not sure what circumstances you would need this (Don't want to display the timestamp for some reason?) [note: $wgLogActionsHandlers might be new-ish, so its possible it didn't exist when you wrote this]
not needed re: bawolff's comments, or rather FIXED!