Brett O'Donnell a écrit :
Hi guys, Just one quick question, is there a way to limit people's access to the "export" function? I don't really need "nuclear secrets" level of security and protection, but I'm just trying to implement a few "don't steal all my stuff" measures.
you *can* slightly modify includes/SpecialExport.php and LocalSettings.php :
in includes/SpecialExport.php add global $wgUser and check 'export' permission :
function wfSpecialExport( $page = '' ) { global $wgOut, $wgRequest, $wgExportAllowListContributors; global $wgExportAllowHistory, $wgExportMaxHistory; /*ADD THIS*/ global $wgUser; if ( !$wgUser->isAllowed('export') ) { $wgOut->addWikiText( wfMsg( "noexportallowed" ) ); return; }
/*FILE CONTINUES*/ $curonly = true; $doexport = false;
in LocalSettings.php, simply give any group the 'export' permission. e.g. : $wgGroupPermissions['sysop']['export'] = true; //gives export permission to sysop group
Finally, create a page in your wiki named : Mediawiki:Noexportallowed and put some text in it (e.g. "you must be an admin to use export special page")
NB : you'll have to make these changes (and possibly adapt them) each time you upgrade mediawiki to newer version NB2 : I'm sure I've already seen how to do this in LocalSettings.php without hacking the core code, but I can't remember how (it wasn't a hook it was a kind of function overwriting)