returning false prevents the preferences from being saved.
$form: the PreferencesForm
$user: the User object to save preferences to
-$message: change this to set an error message (ignored if the hook does notreturn fals)
+$message: change this to set an error message (ignored if the hook does not return false)
+$old: old preferences of the user
'SearchUpdate': Prior to search update completion
$id : Page id
}
}
$wgUser->setRealName( $this->mRealName );
+ $oldOptions = $wgUser->mOptions;
if( $wgUser->getOption( 'language' ) !== $this->mUserLanguage ) {
$needRedirect = true;
}
}
- if (!$wgAuth->updateExternalDB($wgUser)) {
+ if( !$wgAuth->updateExternalDB( $wgUser ) ){
$this->mainPrefsForm( 'error', wfMsg( 'externaldberror' ) );
return;
}
$msg = '';
- if ( !wfRunHooks( 'SavePreferences', array( $this, $wgUser, &$msg ) ) ) {
+ if ( !wfRunHooks( 'SavePreferences', array( $this, $wgUser, &$msg, $oldOptions ) ) ) {
$this->mainPrefsForm( 'error', $msg );
return;
}
if( $needRedirect && $error === false ) {
$title = SpecialPage::getTitleFor( 'Preferences' );
- $wgOut->redirect($title->getFullURL('success'));
+ $wgOut->redirect( $title->getFullURL( 'success' ) );
return;
}