From b4746dab12acfca05ad3f521b8cbfa04911593e3 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sat, 17 May 2003 04:40:09 +0000 Subject: [PATCH] Option to hide IP addresses in page header so can use file page cache --- includes/Skin.php | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 407f2fc936..c8733acc77 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -407,29 +407,32 @@ function toggleVisibility( _levelId, _otherId, _linkId) { function nameAndLogin() { - global $wgUser, $wgTitle, $wgLang; + global $wgUser, $wgTitle, $wgLang, $wgShowIPinHeader; $li = $wgLang->specialPage( "Userlogin" ); $lo = $wgLang->specialPage( "Userlogout" ); $s = ""; if ( 0 == $wgUser->getID() ) { - $n = getenv( "REMOTE_ADDR" ); + if( $wgShowIPinHeader ) { + $n = getenv( "REMOTE_ADDR" ); + + $tl = $this->makeKnownLink( $wgLang->getNsText( + Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}", + $wgLang->getNsText( Namespace::getTalk( 0 ) ) ); + + $s .= $n . " (".$tl.")"; + } else { + $s .= wfMsg("notloggedin"); + } + $rt = $wgTitle->getPrefixedURL(); if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) { $q = ""; } else { $q = "returnto={$rt}"; } - - - $tl = $this->makeKnownLink( $wgLang->getNsText( - Namespace::getTalk( Namespace::getUser() ) ) . ":{$n}", - $wgLang->getNsText( Namespace::getTalk( 0 ) ) ); - - $s .= $n . " (".$tl.")" . "\n
" . $this->makeKnownLink( $li, - wfMsg( "login" ), $q ); - - $tl = " ({$tl})"; + $s .= "\n
" . $this->makeKnownLink( $li, + wfMsg( "login" ), $q ); } else { $n = $wgUser->getName(); $rt = $wgTitle->getPrefixedURL(); -- 2.20.1