Last modified: 2010-05-15 15:51:56 UTC
Would it be possible to add a hook in 'SpecialPreferences.php' to trap changes in user preferences? [[mw:User:Jldupont]]
What hook parameters?
I would suggest something along the following lines: <code>wfRunHooks( 'UserSettingsChanging', array( $this, $wgUser ) );</code> at the ~ top of 'SpecialPreferences::savePreferences'; this way, the event handler function can have access to the 'before' and 'changed' parameters.
I don't think there's much point in passing a global to a hook. It can, after all, just access it itself.
(In reply to comment #3) > I don't think there's much point in passing a global to a hook. It can, after > all, just access it itself. > True, assuming this event will only be triggered at this one place, but what about other potential places? E.g. what about a 'Special Page' of some nature that allows modification to some other user's preferences? Just a thought.
Okay, yeah, I agree with that. Cut down global use where possible.
The SavePreferences hook was added in 1.11 (sometime between this bug and 10 Sept 2007)