[dokuwiki] Re: inconsistent usage of DOKU_TPL / DOKU_TPLINC

  • From: Roland Hager <roland.hager@xxxxxxxxxxxx>
  • To: "dokuwiki@xxxxxxxxxxxxx" <dokuwiki@xxxxxxxxxxxxx>
  • Date: Fri, 17 Sep 2010 14:37:02 +0200

On 17.09.2010 11:31, Michael Hamann wrote:
[...]
I've already opened a feature request for this in February 2009, see
http://bugs.dokuwiki.org/index.php?do=details&task_id=1596.
I just searched the Mailarchiv and forgot to check that. Thanks for the hint.

  I would also like
to see this implemented, perhaps you could share your fixes as a (git) patch?
By now I just did a little dirty hack to see if its working at all. But I think I can invest some time to implement a bit more "the right way". I'm not familiar with git but I guess a boring diff-style diff will also do it ;-)

The main reason why this hasn't already been implemented is that I still
haven't found the time to implement and test this properly and that from what I
remember a lot of other developers don't see the need for custom templates for
animals as that might cause security risks when you can't trust the animal
owners but would give them the option to install custom templates. If you could
provide that patch perhaps that can be discussed today or tomorrow at the
DokuWiki Hackfest (tomorrow I will be there, too).

I actually do not see a security risk - in our environment. Each animal is a separate vhost and php is running via fcgid and suexec. So the whole wiki, including all scripts in the separate templatedir, would be executed with different users. The central core-installation is read-only for all. Last but not least we are pleased to trust our closed user-community here at the university or at least don't expect them to be evil. If anyone sees a security risk in his / hers environment - well just don't use the feature.

I try to get the patch ready today, but I'am afraid I won't make it that fast.
Okay - I fixed this for me and now the output is correct - BUT - I
cannot choose the templates on the admin/configuration site. The
templates shown here are just these from the default dir. This was the
point where I decided to contact YOU to ask:
That can be changed, see the config.metadata.php file mentioned in the
bugreport.

[...]
Thanks, I must have overseen that in my grep-output.

I've done some search in the code when I created that bugreport, it seems you
haven't found everything I've found but to me it seemed very limited.
[...]
I kindly ingnored the favicon-stuff in the first run, because it is not essential to get it going at all.

I think that just using DOKU_TPLINC and DOKU_TPL isn't enough as in some places
like the configuration manager you also need the path to the directory where
the templates are in. So probably a new constant with the path to all templates
will be needed, or even with multiple paths in order to make it possible that
animals can both choose their own templates and the ones provided by the
farmer.

Well - thats right. Either we ommit the templatename itself from DOKU_TPLINC and add $conf['template'] whereever it is needed or, maybe more backportable, we add something like DOKU_TPLBASEDIR


Thanks for your fast reply! It's nice to know not to be the only one having trouble

Roland Hager

Other related posts: