+ Reply to Thread
Results 1 to 5 of 5

Thread: Hide user IP and show 'anonymous' instead

Share/Bookmark

Threaded View

  1. #1
    Junior Member Merk is on a distinguished road
    Join Date
    Jun 2007
    Posts
    4
    Rep Power
    4

    Default Hide user IP and show 'anonymous' instead

    Is it possible to show a generic name like "anonymous coward" instead of the user's IP when they edit without logging in?

  2. #2
    Junior Member Kinslayer is on a distinguished road
    Join Date
    Mar 2008
    Posts
    1
    Rep Power
    3

    Default

    Yeah, try this.

    Edit includes/User.php, search for "$this->mName = IP::santiizeIP" (line 1155 on 1.11), comment out that line and replace it with "$this->mName = 'Anonymous Coward';

    This seems to work for recent changes and page history. I haven't been trying it for long and didn't make much effort to check for implications... but like I said it seems to work great.

  3. #3
    Junior Member Verto is an unknown quantity at this point
    Join Date
    Mar 2009
    Posts
    1
    Rep Power
    2

    Exclamation + Question

    Its good code ($this->mName = 'Anonymous Coward', but this code hides real IP's from all.

    How to make that real IP's were snown for sysop's and bureaucrats only?

    Regards, Verto

  4. #4
    Junior Member meikrosoft is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    9
    Rep Power
    2

    Default

    hi,

    you can use getGroups() from the user.php to get an array of the groups of the logged in user. now you had to check if your groupname is in the array.

    example:
    global $wgUser;
    if(in_array('sysop', $wgUser->getGroups())
    {
    do it
    }



    greets
    meikrosoft

  5. #5
    Junior Member meikrosoft is an unknown quantity at this point
    Join Date
    Aug 2009
    Posts
    9
    Rep Power
    2

    Default

    hi,

    sorry double post

    meikrosoft

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts