Topic on Project:Support desk

Pompelpilt (talkcontribs)

Dear All.

I have a custom namespace where sensitive information are stored. Only logged in users are allowed to read and alter the contents of this namespace. However, changes made in this sensitive namespace show up in RSS feed and recent changes. Are there any option to exclude this namespace from triggering recent changes?

Regards

Ciencia Al Poder (talkcontribs)

See Manual:Preventing access. basically, a wiki is not made to have per-namespace read protection. That information could be leaked in a lot of different ways.

You should probably want to create a different wiki for that, and make it private, instead of using a namespace for that.

Pompelpilt (talkcontribs)

Thanks for your reply. I have perfect control over access to the namespace with sensitive information. Users are required to log on when they want to see articles in that namespace. That works like a charm. The problem is that information provided in this namespace leaks through "Recent changes" and RSS feed witch can be viewed by anyone. I could probably restrict access to "Recent changes" and disable RSS feed, but I would prefer to keep those running.

Bawolff (talkcontribs)

You need custom hook. Try adding to bottom of LocalSettings.php

$wgHooks['SpecialRecentChangesQuery'][] = 'wfHideChanges';
function wfHideChanges( $conds ) {
$hiddenNS = 123; // Replace this with the namespace NUMBER (not its name) that you want to hide.
$conds[] = 'page_namespace != ' . $hiddenNS;
return true;
}

Untested. I probably made a typo somewhere. no guarantees it works. Probably lots of other side methods of accessing page contents (including as templates, other special pages, special:allpages, etc).

79.160.210.58 (talkcontribs)

Well, I tested it, and it did produce a recent changes event and an RSS feed. I changed the namespace number before I did the test. That was the only change needed, right?

Unfortunately, I have little knowledge of the programming language here, so I have no idea what to look for. Thanks anyway. Any other ideas?

Pompelpilt (talkcontribs)
Florianschmidtwelzow (talkcontribs)
Pompelpilt (talkcontribs)

Okay.

If that's the case, why do I get this line in my debug?

[deprecated] Use of SpecialRecentChangesQuery hook (used in wfHideChanges) was 
deprecated in MediaWiki 1.23. [Called from wfRunHooks in C:\inetpub\wwwroot
\MediaWiki v1.23.6\includes\GlobalFunctions.php at line 4013]

It's a very specific message. I see from the docs that it's supposed to be deprecated in 1.24, but I'm running 1.23.

Florianschmidtwelzow (talkcontribs)

Sorry, it was deprecated with MediaWiki 1.23, that's an error in the doc here on mediawiki.org. I changed that.

Pompelpilt (talkcontribs)

Dear All.

I had a hard time letting go of my initial goal here. I generally try to stay away from extensions with status 'beta', but by desperation I downloaded the https://www.mediawiki.org/wiki/Extension:RecentChangesOption and tried that. I was a bit surprised to find it worked! Changes made to articles in my protected namespace does not show in RSS feed nor Recent Changes.

The code in RecentChangesOption.php uses the hook SpecialRecentChangesQuery witch is supposed to be deprecated in my MW 1.23. I still get the same log in my debug. I'm scratching my head here. Am I on dangerous ground by using an extension that uses a deprecated hook?

Regards

Pompelpilt (talkcontribs)
Ciencia Al Poder (talkcontribs)

The only "danger" in using an extension that uses a deprecated hook is that, if you upgrade MediaWiki to a newer major release (let's say MediaWiki 1.23 to 1.24) and the hook is removed on that version, the extension will no longer work. In the case of hooks, it won't produce any error, but MediaWiki won't call it anywhere.

Note that deprecated hooks, method, etc indicate that an alternative exist, and code should be modified so it will work properly on newer versions, but those hooks doesn't necessarily need to be removed on the next release. They may (or may not) last several new release without being removed.

Reply to "Recent changes"