Extension talk:ProtectSource

To protect all pages
If you want to protect all pages, not only protect protected pages, you can comment Line 62~64 in ProtectSource.php. But it will cause Anonymous reading error in MediaWiki:Common.css, so CSS of skins cannot shows correctly. Therefore, the Namespace of MediaWiki cannot be protected by this extension.

My modify is to protect all pages except Namespace of MediaWiki, as following.

Modify In ProtectSource.php
find code:

change to:

find code:

change to:

Customize in LocalSettings.php
If you want editor can see source and anonymous dosenot, for example:

Chienwen 04:15, 2 September 2009 (UTC)

Common.js
Even with this fix, there seem to be problems reading the common.js file (even though it is in the MediaWiki namespace). In particular, the hide/show feature of NavFrame is disabled. Using the original extension code, this does not happen (even on protected pages). Any ideas?


 * Then don't use it? What's the use in protecting ALL pages anyway? --Subfader 15:49, 13 May 2010 (UTC)
 * I am hiding part of the page from anonymous users (with the PrivateBlocks extension) and thus don't want them seeing the source. Eventually most pages will have this, so I don't want to have to manually set a page as protected. Plus, the pages shouldn't really be protected, since any registered users should be able to edit. --Oscarlevin 16:21, 13 May 2010 (UTC)
 * Although I'm still curious why common.js is not read correctly, I found a workaround for my problem: instead of checking whether the page is unprotected, I check whether the page contains either of two key words (that are on every page on which I want to protect the source -- I don't care if some other pages get included accidentally). If the page does not contain those words, I return "true."  This had the desired effect. -- Oscarlevin 20:20, 13 May 2010 (UTC)