Hello
I use Dokuwiki 2014-09-29d "Hrun" and I needed to disable some actions for guests (not logged-in users). But Dokuwiki allows only to disable actions completely for all, so I made this simple hack. If somebody else need it, here it is. For instance, if you want to disable for guests Recent changes, Media Manager and Sitemap, in the file inc/confutils.php edit function actionOK():
Search:
==========
return !in_array($action,$disabled);
}
==========
Replace to:
==========
if(!empty($_SERVER['REMOTE_USER']))
return !in_array($action,$disabled);
if(in_array($action, Array('recent', 'media', 'index'))) //array of actions to disable
return false;
else
return !in_array($action,$disabled);
}
==========
As a bonus to this hack is that links to disabled actions will be automatically hidden.
And what DW developers think about add this option to DW? This is simple: make new editbox on the Config page (under 'Disable DokuWiki actions'), this editbox will fill new config value $conf['disableactions4guests'], in the actionOK() function explode this string in array and compare. This is very simple. Do you think other users don't need it?
PS: List of DokuWiki actions is
here, but it may be incomplete.
Bye