webif: Fix possible segfault when template is read from disk.

strstr() can segfault if the data read in the buffer is not \0
terminated. This can happend if try to read binary file.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8433 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Create and use private templates array.

This allows storing of additional information along with templates
data (which is const).

For now we store name hash but in the future the data that comes from
struct templates (in webif/pages.c) may need to be preprocessed
(uncompressed for example) and the abstraction in this commit makes
it easier to do such changes.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8434 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Remove the need to save config info in struct templates.

Configuration data for templates was introduced in commit r7221
as a way to fix ticket #2665.

Basically we kept the configuration deps in the template and when we
loaded the template from file we checked if the config items are enabled.
If they weren't we ignorred the template like it didn't exist.

But now there is a better way. If config item was disabled when the
binary was built then the template does not exist in struct templates
at all.

So we can just check if the requested template exists in struct templates,
and if it doesn't exists we just don't try to load it from file, so the
problem in ticket #2665 is still solved but we remove lots of code (one
less place place that knows about configuration items, yay!) and lower
the binary size by ~1.4k.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8435 4b0bc96b-bc66-0410-9d44-ebda105a78c1
webif: Simplify template loading and checking.

The subdir logic seems to complicate the code for no good reason and
as far as I can work out it does nothing. It looks like a leftover
that can be removed.

git-svn-id: http://streamboard.de.vu/svn/oscam/trunk@8436 4b0bc96b-bc66-0410-9d44-ebda105a78c1