Mediawiki/Anonymous IP Hash: Difference between revisions

From Bibliotheca Anonoma
(Created page with "Here's the gist of my anon ID hack to MediaWiki. I can't really package it as an extension or anything because it involves hacking things that apparently aren't supposed to be...")
 
No edit summary
Line 15: Line 15:
</pre>
</pre>


(Obviously you'd change the "PUT RANDOM TEXT HERE" to some random text. Just bang on the keyboard for a bit, or if you want to be truly random, roll some dice.)
{{Note|Obviously you'd change the "PUT RANDOM TEXT HERE" to some random text. Just bang on the keyboard for a bit, or if you want to be truly random, roll some dice.}}


2. In includes/User.php, find the line that says
2. In includes/User.php, find the line that says
</pre>
 
     $this->mName = IP::sanitizeIP( wfGetIP() );
     $this->mName = IP::sanitizeIP( wfGetIP() );
</pre>
 
... and change it to ...
... and change it to ...
<pre>
 
     $this->mName = AnonUsername();
     $this->mName = AnonUsername();
</pre>


== aa tags ==
== aa tags ==

Revision as of 15:53, 16 November 2016

Here's the gist of my anon ID hack to MediaWiki. I can't really package it as an extension or anything because it involves hacking things that apparently aren't supposed to be hacked, but it's not hard to do. - Halcy

1. Add the following to your LocalSettings.php:

// you can leave anon talk pages on, but you'll
// likely end up with useless crud after IDs expire
$wgDisableAnonTalk = true;
function AnonUsername() {
        # dmY = new ID per day, WY = per week
        $key = wfGetIP().'PUT RANDOM TEXT HERE'.gmdate('dmY');
        return 'ID:'.substr(crypt(md5($key), 'id'), 2, 8);
}
Note: Obviously you'd change the "PUT RANDOM TEXT HERE" to some random text. Just bang on the keyboard for a bit, or if you want to be truly random, roll some dice.

2. In includes/User.php, find the line that says

   $this->mName = IP::sanitizeIP( wfGetIP() );

... and change it to ...

   $this->mName = AnonUsername();

aa tags

On a slightly related note, I hacked an extension together for <aa> tags.

  • Music:DQN-kun / >>6 is not a panda

http://storlek.livejournal.com/47939.html?thread=47171