I'm using Dokuwiki as a kind of mixed wiki/CMS and want to limit things like 'Recent Changes', 'Show Pagesource', etc, to authenticated users only. Having looked through the forums and wiki I couldn't find anything that covers that.
I've ended up editing template.php to check if the users is logged in and redirect them to the login page if they're not like so;
case 'recent':
if ($_SERVER['REMOTE_USER'])
{
$first = is_numeric($_REQUEST['first']) ? intval($_REQUEST['first']) : 0;
html_recent($first);
}
else
html_login();
break;
However there are a couple of things I don't like about this.
1) I need to do it for every function I want to limit to authenticated users.
2) I'm using Debian and would guess that if the dokuwiki package is updated (say for security reasons), tempate.php will be over written.
Is there an easier way of doing this that I've missed? I looked at action events which I think may be a cleaner way of doing it, but not being a PHP person I got a bit lost.
Can anybody offer any insight on this one?
Red