var $mReset, $mPosted, $mToggles, $mSearchNs, $mRealName;
function PreferencesForm( &$request ) {
- global $wgLang;
+ global $wgLang, $wgAllowRealName;
$this->mQuickbar = $request->getVal( 'wpQuickbar' );
$this->mOldpass = $request->getVal( 'wpOldpass' );
$this->mMath = $request->getVal( 'wpMath' );
$this->mDate = $request->getVal( 'wpDate' );
$this->mUserEmail = $request->getVal( 'wpUserEmail' );
- $this->mRealName = $request->getVal( 'wpRealName' );
+ $this->mRealName = ($wgAllowRealName) ? $request->getVal( 'wpRealName' ) : '';
$this->mEmailFlag = $request->getCheck( 'wpEmailFlag' ) ? 1 : 0;
$this->mNick = $request->getVal( 'wpNick' );
$this->mSearch = $request->getVal( 'wpSearch' );
/* private */ function resetPrefs()
{
- global $wgUser, $wgLang;
+ global $wgUser, $wgLang, $wgAllowRealName;
$this->mOldpass = $this->mNewpass = $this->mRetypePass = "";
$this->mUserEmail = $wgUser->getEmail();
- $this->mRealName = $wgUser->getRealName();
+ $this->mRealName = ($wgAllowRealName) ? $wgUser->getRealName() : '';
if ( 1 == $wgUser->getOption( "disablemail" ) ) { $this->mEmailFlag = 1; }
else { $this->mEmailFlag = 0; }
$this->mNick = $wgUser->getOption( "nickname" );
/* private */ function mainPrefsForm( $err )
{
global $wgUser, $wgOut, $wgLang, $wgUseDynamicDates, $wgValidSkinNames;
-
+ global $wgAllowRealName;
+
$wgOut->setPageTitle( wfMsg( "preferences" ) );
$wgOut->setArticleRelated( false );
$wgOut->setRobotpolicy( "noindex,nofollow" );
$tzGuess = wfMsg( "guesstimezone" );
$tzServerTime = wfMsg( "servertime" );
$yem = wfMsg( "youremail" );
- $yrn = wfMsg( "yourrealname" );
+ $yrn = ($wgAllowRealName) ? wfMsg( "yourrealname" ) : '';
$emf = wfMsg( "emailflag" );
$ynn = wfMsg( "yournick" );
$stt = wfMsg ( "stubthreshold" ) ;
$ps = $this->namespacesCheckboxes();
$wgOut->addHTML( "<fieldset>
- <legend>".wfMsg('prefs-personal')."</legend>
- <div><label>$yrn: <input type='text' name=\"wpRealName\" value=\"{$this->mRealName}\" size='20' /></label></div>
+ <legend>".wfMsg('prefs-personal')."</legend>");
+ if ($wgAllowRealName) {
+ $wgOut->addHTML("<div><label>$yrn: <input type='text' name=\"wpRealName\" value=\"{$this->mRealName}\" size='20' /></label></div>");
+ }
+ $wgOut->addHTML("
<div><label>$yem: <input type='text' name=\"wpUserEmail\" value=\"{$this->mUserEmail}\" size='20' /></label></div>
<div><label><input type='checkbox' $emfc value=\"1\" name=\"wpEmailFlag\" /> $emf</label></div>
<div><label>$ynn: <input type='text' name=\"wpNick\" value=\"{$this->mNick}\" size='12' /></label></div>\n" );
-
+
# Fields for changing password
#
$this->mOldpass = wfEscapeHTML( $this->mOldpass );
var $mLoginattempt, $mRemember, $mEmail;
function LoginForm( &$request ) {
- global $wgLang;
+ global $wgLang, $wgAllowRealName;
$this->mName = $request->getText( 'wpName' );
$this->mPassword = $request->getText( 'wpPassword' );
$this->mAction = $request->getVal( 'action' );
$this->mRemember = $request->getCheck( 'wpRemember' );
$this->mEmail = $request->getText( 'wpEmail' );
- $this->mRealName = $request->getText( 'wpRealName' );
-
+ if ($wgAllowRealName) {
+ $this->mRealName = $request->getText( 'wpRealName' );
+ } else {
+ $this->mRealName = '';
+ }
+
# When switching accounts, it sucks to get automatically logged out
if( $this->mReturnto == $wgLang->specialPage( "Userlogout" ) ) {
$this->mReturnto = "";
/* private */ function mainLoginForm( $err )
{
global $wgUser, $wgOut, $wgLang;
- global $wgDBname;
+ global $wgDBname, $wgAllowRealName;
$le = wfMsg( "loginerror" );
$yn = wfMsg( "yourname" );
$ca = wfMsg( "createaccount" );
$cam = wfMsg( "createaccountmail" );
$ye = wfMsg( "youremail" );
- $yrn = wfMsg( "yourrealname" );
+ if ($wgAllowRealName) {
+ $yrn = wfMsg( "yourrealname" );
+ } else {
+ $yrn = '';
+ }
$efl = wfMsg( "emailforlost" );
$mmp = wfMsg( "mailmypassword" );
$endText = wfMsg( "loginend" );
<td align='right'>$ye:</td>
<td align='left'>
<input tabindex='6' type='text' name=\"wpEmail\" value=\"{$encEmail}\" size='20' />
- </td>
- <td> </td>
- </tr>
- <tr>
- <td align='right'>$yrn:</td>
- <td align='left'>
- <input tabindex='6' type='text' name=\"wpRealName\" value=\"{$encRealName}\" size='20' />
- </td>
- <td align='left'>
+ </td>");
+
+ if ($wgAllowRealName) {
+ $wgOut->addHTML("<td> </td>
+ </tr><tr>
+ <td align='right'>$yrn:</td>
+ <td align='left'>
+ <input tabindex='6' type='text' name=\"wpRealName\" value=\"{$encRealName}\" size='20' />
+ </td>");
+ }
+
+ $wgOut->addHTML("<td align='left'>
<input tabindex='7' type='submit' name=\"wpCreateaccount\" value=\"{$ca}\" />
$cambutton
</td></tr>");
}
-
+
$wgOut->addHTML("
<tr><td colspan='3'> </td></tr><tr>
<td colspan='3' align='left'>