Last modified: 2011-04-14 15:10:43 UTC
In addition to the current opt-out of wgDisabledActions, it would be nice to be able to disable all actions and only allow some of them. For example, if one disables "edit", one also has to remember to disable "editredlink", etc. A very simple implementation is to modify in include/Wiki.php: if( in_array( $action, $this->getVal( 'DisabledActions', array() ) ) ) { to: if( in_array( $action, $this->getVal( 'DisabledActions', array() ) ) || ( in_array( '*', $this->getVal( 'DisabledActions', array() ) ) && ! in_array( $action, $this->getVal( 'EnabledActions', array() ) ))) { and add a $mediaWiki->setVal( 'EnabledActions', $wgEnabledActions ); to index.php One could therefore disable all actions by setting: $wgDisabledActions = array('*'); and then allow some: $wgEnabledActions = array('view'); One nice application is for those using mediawiki as a webpage for non registered users (I know, it is not made for it, but this modification is really minor), as one can have in LocalSettings.php: $wgHooks['MediaWikiPerformAction'][] = 'fnEditingForRegisteredUsersOnly'; function fnEditingForRegisteredUsersOnly( $output, $article, $title, $user, $request, $wiki ) { global $wgDisabledActions,$wgEnabledActions; if(!$user->isLoggedIn()) { $wgDisabledActions = array('*'); $wgEnabledActions = array('view'); } return true; } and only allow the view action to visitors.