Index: trunk/phase3/includes/SpecialPreferences.php |
— | — | @@ -14,7 +14,7 @@ |
15 | 15 | var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName; |
16 | 16 | |
17 | 17 | function PreferencesForm( &$request ) { |
18 | | - global $wgLang; |
| 18 | + global $wgLang, $wgAllowRealName; |
19 | 19 | |
20 | 20 | $this->mQuickbar = $request->getVal( 'wpQuickbar' ); |
21 | 21 | $this->mOldpass = $request->getVal( 'wpOldpass' ); |
— | — | @@ -27,7 +27,7 @@ |
28 | 28 | $this->mMath = $request->getVal( 'wpMath' ); |
29 | 29 | $this->mDate = $request->getVal( 'wpDate' ); |
30 | 30 | $this->mUserEmail = $request->getVal( 'wpUserEmail' ); |
31 | | - $this->mRealName = $request->getVal( 'wpRealName' ); |
| 31 | + $this->mRealName = ($wgAllowRealName) ? $request->getVal( 'wpRealName' ) : ''; |
32 | 32 | $this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 1 : 0; |
33 | 33 | $this->mNick = $request->getVal( 'wpNick' ); |
34 | 34 | $this->mSearch = $request->getVal( 'wpSearch' ); |
— | — | @@ -180,11 +180,11 @@ |
181 | 181 | |
182 | 182 | /* private */ function resetPrefs() |
183 | 183 | { |
184 | | - global $wgUser, $wgLang; |
| 184 | + global $wgUser, $wgLang, $wgAllowRealName; |
185 | 185 | |
186 | 186 | $this->mOldpass = $this->mNewpass = $this->mRetypePass = ""; |
187 | 187 | $this->mUserEmail = $wgUser->getEmail(); |
188 | | - $this->mRealName = $wgUser->getRealName(); |
| 188 | + $this->mRealName = ($wgAllowRealName) ? $wgUser->getRealName() : ''; |
189 | 189 | if ( 1 == $wgUser->getOption( "disablemail" ) ) { $this->mEmailFlag = 1; } |
190 | 190 | else { $this->mEmailFlag = 0; } |
191 | 191 | $this->mNick = $wgUser->getOption( "nickname" ); |
— | — | @@ -265,7 +265,8 @@ |
266 | 266 | /* private */ function mainPrefsForm( $err ) |
267 | 267 | { |
268 | 268 | global $wgUser, $wgOut, $wgLang, $wgUseDynamicDates, $wgValidSkinNames; |
269 | | - |
| 269 | + global $wgAllowRealName; |
| 270 | + |
270 | 271 | $wgOut->setPageTitle( wfMsg( "preferences" ) ); |
271 | 272 | $wgOut->setArticleRelated( false ); |
272 | 273 | $wgOut->setRobotpolicy( "noindex,nofollow" ); |
— | — | @@ -306,7 +307,7 @@ |
307 | 308 | $tzGuess = wfMsg( "guesstimezone" ); |
308 | 309 | $tzServerTime = wfMsg( "servertime" ); |
309 | 310 | $yem = wfMsg( "youremail" ); |
310 | | - $yrn = wfMsg( "yourrealname" ); |
| 311 | + $yrn = ($wgAllowRealName) ? wfMsg( "yourrealname" ) : ''; |
311 | 312 | $emf = wfMsg( "emailflag" ); |
312 | 313 | $ynn = wfMsg( "yournick" ); |
313 | 314 | $stt = wfMsg ( "stubthreshold" ) ; |
— | — | @@ -332,12 +333,15 @@ |
333 | 334 | $ps = $this->namespacesCheckboxes(); |
334 | 335 | |
335 | 336 | $wgOut->addHTML( "<fieldset> |
336 | | - <legend>".wfMsg('prefs-personal')."</legend> |
337 | | - <div><label>$yrn: <input type='text' name=\"wpRealName\" value=\"{$this->mRealName}\" size='20' /></label></div> |
| 337 | + <legend>".wfMsg('prefs-personal')."</legend>"); |
| 338 | + if ($wgAllowRealName) { |
| 339 | + $wgOut->addHTML("<div><label>$yrn: <input type='text' name=\"wpRealName\" value=\"{$this->mRealName}\" size='20' /></label></div>"); |
| 340 | + } |
| 341 | + $wgOut->addHTML(" |
338 | 342 | <div><label>$yem: <input type='text' name=\"wpUserEmail\" value=\"{$this->mUserEmail}\" size='20' /></label></div> |
339 | 343 | <div><label><input type='checkbox' $emfc value=\"1\" name=\"wpEmailFlag\" /> $emf</label></div> |
340 | 344 | <div><label>$ynn: <input type='text' name=\"wpNick\" value=\"{$this->mNick}\" size='12' /></label></div>\n" ); |
341 | | - |
| 345 | + |
342 | 346 | # Fields for changing password |
343 | 347 | # |
344 | 348 | $this->mOldpass = wfEscapeHTML( $this->mOldpass ); |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -390,6 +390,10 @@ |
391 | 391 | # See list of skins and their symbolic names in language/Language.php |
392 | 392 | $wgDefaultSkin = "monobook"; |
393 | 393 | |
| 394 | +# Whether or not to allow real name fields. Defaults to true. |
| 395 | + |
| 396 | +$wgAllowRealName = true; |
| 397 | + |
394 | 398 | # Extensions |
395 | 399 | $wgExtensionFunctions = array(); |
396 | 400 | ?> |
Index: trunk/phase3/includes/SpecialUserlogin.php |
— | — | @@ -20,7 +20,7 @@ |
21 | 21 | var $mLoginattempt, $mRemember, $mEmail; |
22 | 22 | |
23 | 23 | function LoginForm( &$request ) { |
24 | | - global $wgLang; |
| 24 | + global $wgLang, $wgAllowRealName; |
25 | 25 | |
26 | 26 | $this->mName = $request->getText( 'wpName' ); |
27 | 27 | $this->mPassword = $request->getText( 'wpPassword' ); |
— | — | @@ -35,8 +35,12 @@ |
36 | 36 | $this->mAction = $request->getVal( 'action' ); |
37 | 37 | $this->mRemember = $request->getCheck( 'wpRemember' ); |
38 | 38 | $this->mEmail = $request->getText( 'wpEmail' ); |
39 | | - $this->mRealName = $request->getText( 'wpRealName' ); |
40 | | - |
| 39 | + if ($wgAllowRealName) { |
| 40 | + $this->mRealName = $request->getText( 'wpRealName' ); |
| 41 | + } else { |
| 42 | + $this->mRealName = ''; |
| 43 | + } |
| 44 | + |
41 | 45 | # When switching accounts, it sucks to get automatically logged out |
42 | 46 | if( $this->mReturnto == $wgLang->specialPage( "Userlogout" ) ) { |
43 | 47 | $this->mReturnto = ""; |
— | — | @@ -301,7 +305,7 @@ |
302 | 306 | /* private */ function mainLoginForm( $err ) |
303 | 307 | { |
304 | 308 | global $wgUser, $wgOut, $wgLang; |
305 | | - global $wgDBname; |
| 309 | + global $wgDBname, $wgAllowRealName; |
306 | 310 | |
307 | 311 | $le = wfMsg( "loginerror" ); |
308 | 312 | $yn = wfMsg( "yourname" ); |
— | — | @@ -313,7 +317,11 @@ |
314 | 318 | $ca = wfMsg( "createaccount" ); |
315 | 319 | $cam = wfMsg( "createaccountmail" ); |
316 | 320 | $ye = wfMsg( "youremail" ); |
317 | | - $yrn = wfMsg( "yourrealname" ); |
| 321 | + if ($wgAllowRealName) { |
| 322 | + $yrn = wfMsg( "yourrealname" ); |
| 323 | + } else { |
| 324 | + $yrn = ''; |
| 325 | + } |
318 | 326 | $efl = wfMsg( "emailforlost" ); |
319 | 327 | $mmp = wfMsg( "mailmypassword" ); |
320 | 328 | $endText = wfMsg( "loginend" ); |
— | — | @@ -401,20 +409,23 @@ |
402 | 410 | <td align='right'>$ye:</td> |
403 | 411 | <td align='left'> |
404 | 412 | <input tabindex='6' type='text' name=\"wpEmail\" value=\"{$encEmail}\" size='20' /> |
405 | | - </td> |
406 | | - <td> </td> |
407 | | - </tr> |
408 | | - <tr> |
409 | | - <td align='right'>$yrn:</td> |
410 | | - <td align='left'> |
411 | | - <input tabindex='6' type='text' name=\"wpRealName\" value=\"{$encRealName}\" size='20' /> |
412 | | - </td> |
413 | | - <td align='left'> |
| 413 | + </td>"); |
| 414 | + |
| 415 | + if ($wgAllowRealName) { |
| 416 | + $wgOut->addHTML("<td> </td> |
| 417 | + </tr><tr> |
| 418 | + <td align='right'>$yrn:</td> |
| 419 | + <td align='left'> |
| 420 | + <input tabindex='6' type='text' name=\"wpRealName\" value=\"{$encRealName}\" size='20' /> |
| 421 | + </td>"); |
| 422 | + } |
| 423 | + |
| 424 | + $wgOut->addHTML("<td align='left'> |
414 | 425 | <input tabindex='7' type='submit' name=\"wpCreateaccount\" value=\"{$ca}\" /> |
415 | 426 | $cambutton |
416 | 427 | </td></tr>"); |
417 | 428 | } |
418 | | - |
| 429 | + |
419 | 430 | $wgOut->addHTML(" |
420 | 431 | <tr><td colspan='3'> </td></tr><tr> |
421 | 432 | <td colspan='3' align='left'> |