Last modified: 2009-07-03 13:14:30 UTC
It is very important that you test $wgEnableEmail before showing the user ANY email related preferences. Or else we * make the user think the wiki has features enabled but in fact they are disabled. * cause some users to type in personal information that we DO NOT want to collect, and is only useful for disabled features. Please read the definition of $wgEnableEmail in DefaultSettings.php. The following quick workaround in Preferences.php merely shows you where the test should be. You still will need to eliminate duplication within it, and of course test, which I haven't. @@ -270,2 +270,3 @@ ## Email stuff + global $wgEnableEmail; if($wgEnableEmail){#BEGIN QUICK FIX @@ -372,2 +373,3 @@ } + }#END QUICK FIX }
Why do you insist on collecting email addresses even though $wgEnableEmail=false? Wikis may be discussing sensitive topics or located in countries with repressive governments. Collecting email addresses makes the wiki a target for police, phishers, and could get the user fired, outed, or even arrested. Just check $wgEnableEmail before all other email functions, like you do here: specials/SpecialUserlogin.php:878: $template->set( 'useemail', $wgEnableEmail ); templates/Userlogin.php:82: ... if( $this->data['useemail'] && templates/Userlogin.php:172: <?php if( $this->data['useemail'] ) { ?> (However note Bug #10158).
There is no "you". MediaWiki is built by a collaboration of volunteers; you must already know this. No one is "insisting" on anything, it's just that, in the 30 hours between your posts, no one has happened to look at this bug and think it interesting enough for them to spend time fixing. Certainly no one has thought it of such dire importance as to warrant a hackish "quick fix". If you think it *is* important enough to warrant attention, you are encouraged to develop, test, and present a patch yourself, which can be reviewed and applied. See also bug18549.
Created attachment 6138 [details] move $wgEnableEmail test to outermost, fixing the bug
Created attachment 6161 [details] Updated patch so applies to the rapidly changing code. Purposely not indented. Run a beautifier after applying.
One can also do array_push($wgHiddenPrefs,'emailaddress'); for now before the patch is applied.
Done with r52736.