From b87c3f83647f21309b2fec4bb5358a5cddac9edb Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Mon, 4 Aug 2014 21:59:25 +0200 Subject: [PATCH] Group E-mail settings stuff in Setup.php - Move the overrides of e-mail settings along with other configuration corrections instead of being near global object definitions - Also force $wgUseEnotif to false if $wgEnableEmail; previously it could remain true since $wgEnotifUserTalk and $wgEnotifWatchlist were forced to false after they were checked to set $wgUseEnotif - Also put the removal of 'enotifminoredits' preference nearby Change-Id: I9af6bb78d34ce053fc36eaa7cc3852de3ecbee8e --- includes/Setup.php | 53 +++++++++++++++++++++++----------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/includes/Setup.php b/includes/Setup.php index 03c529e5e0..15fe94a75b 100644 --- a/includes/Setup.php +++ b/includes/Setup.php @@ -293,7 +293,33 @@ if ( !$wgCookiePrefix ) { } $wgCookiePrefix = strtr( $wgCookiePrefix, '=,; +."\'\\[', '__________' ); -$wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist; +if ( $wgEnableEmail ) { + $wgUseEnotif = $wgEnotifUserTalk || $wgEnotifWatchlist; +} else { + // Disable all other email settings automatically if $wgEnableEmail + // is set to false. - bug 63678 + $wgAllowHTMLEmail = false; + $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway + $wgEnableUserEmail = false; + $wgEnotifFromEditor = false; + $wgEnotifImpersonal = false; + $wgEnotifMaxRecips = 0; + $wgEnotifMinorEdits = false; + $wgEnotifRevealEditorAddress = false; + $wgEnotifUseJobQ = false; + $wgEnotifUseRealName = false; + $wgEnotifUserTalk = false; + $wgEnotifWatchlist = false; + unset( $wgGroupPermissions['user']['sendemail'] ); + $wgUseEnotif = false; + $wgUserEmailUseReplyTo = false; + $wgUsersNotifiedOnAllChanges = array(); +} + +// Doesn't make sense to have if disabled. +if ( !$wgEnotifMinorEdits ) { + $wgHiddenPrefs[] = 'enotifminoredits'; +} if ( $wgMetaNamespace === false ) { $wgMetaNamespace = str_replace( ' ', '_', $wgSitename ); @@ -346,11 +372,6 @@ if ( $wgUseFileCache || $wgUseSquid ) { $wgDebugToolbar = false; } -// Doesn't make sense to have if disabled. -if ( !$wgEnotifMinorEdits ) { - $wgHiddenPrefs[] = 'enotifminoredits'; -} - // We always output HTML5 since 1.22, overriding these is no longer supported // we set them here for extensions that depend on its value. $wgHtml5 = true; @@ -614,26 +635,6 @@ $wgTitle = null; $wgDeferredUpdateList = array(); -// Disable all other email settings automatically if $wgEnableEmail -// is set to false. - bug 63678 -if ( !$wgEnableEmail ) { - $wgAllowHTMLEmail = false; - $wgEmailAuthentication = false; // do not require auth if you're not sending email anyway - $wgEnableUserEmail = false; - $wgEnotifFromEditor = false; - $wgEnotifImpersonal = false; - $wgEnotifMaxRecips = 0; - $wgEnotifMinorEdits = false; - $wgEnotifRevealEditorAddress = false; - $wgEnotifUseJobQ = false; - $wgEnotifUseRealName = false; - $wgEnotifUserTalk = false; - $wgEnotifWatchlist = false; - unset( $wgGroupPermissions['user']['sendemail'] ); - $wgUserEmailUseReplyTo = false; - $wgUsersNotifiedOnAllChanges = array(); -} - wfProfileOut( $fname . '-globals' ); wfProfileIn( $fname . '-extensions' ); -- 2.20.1