[Mediawiki-l] Preventing bogus User: pages?

DanTMan dan_the_man at telus.net
Tue Jan 8 09:22:33 UTC 2008


^_^ Feel lucky... You poked the coding bone...

Voila...
http://www.mediawiki.org/wiki/Extension:NoBogusUserpages
Fresh off the rack and made for your use.

It stops creation (Not editing) of userpages for users who do not exist. 
I made sure that:
* The extension does not block creation of userpages for IPv4 or IPv6 IP's.
* You can give users (Sysops by default) the ability to create bogus 
userpages.
* The extension properly uses only the part before the /, so you can't 
create [[User:Nonexistant]] or [[User:Nonexistant/subpage]] when 
Nonexistant does not exist. But it does not stop you from creating 
[[User:Dantman/subpage]] when Dantman exists, but 'Dantman/subpage' 
which is invalid, does not exist.

Also, if you are using MediaWiki 1.12 it will use the new hook that lets 
us use a custom access restriction message instead of a generic one.
Just see the warning on that page, it could be a little hazardous if you 
are using MW1.12a but have a version older than r26568 when the new hook 
was added.

BTW, I used access restriction instead of ArticleSave. By doing that, 
the edit link won't show up (In pre 1.12a though it will show view 
source), and a user won't end up going to an edit page, and finding out 
that after they've typed a bunch of stuff up, they cannot create the 
page that they've been writing stuff for.

~Daniel Friesen(Dantman) of:
-The Gaiapedia (http://gaia.wikia.com)
-Wikia ACG on Wikia.com (http://wikia.com/wiki/Wikia_ACG)
-and Wiki-Tools.com (http://wiki-tools.com)

Evan Prodromou wrote:
> Daniel Barrett wrote:
>> How can I prevent the creation of pages in the User: namespace that are
>> not for actual wiki users?  For example, anybody can create an article
>> called "User:nonexistent" when there is no user named "nonexistent".
>>   
> The wiki way to do it is to delete them.
>
> Yeah, yeah, I know... way too simple.
>
> The hard, tedious, "automatic" way is to write a hook for the 
> ArticleSave event that will return an error if the article is in the 
> user namespace and has a title that's not a current user's name. Check 
> out hooks.txt in the doc subdirectory for info.
>
> -Evan
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> MediaWiki-l mailing list
> MediaWiki-l at lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
>   


More information about the MediaWiki-l mailing list