If $wgEnableEmail is false, disable other email settings
authorwithoutaname <drevitchi@gmail.com>
Fri, 9 May 2014 08:24:27 +0000 (01:24 -0700)
committerWithoutaname <drevitchi@gmail.com>
Wed, 9 Jul 2014 18:10:53 +0000 (18:10 +0000)
Bug: 63678
Change-Id: I8464f540f4bd850d6be1c578b043d9702ed8e773

includes/Setup.php

index 78655a4..145f55a 100644 (file)
@@ -627,6 +627,26 @@ $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' );