Protect template against direct access

Discussions and requests related to new CMSimple features, plugins, templates etc. and how to develop.
Please don't ask for support at this forums!

Protect template against direct access

Postby Holger on Fri Feb 05, 2010 7:37 pm

Hi geeks ;) ,

is there any proper idea to protect a template.htm against direkt access?
Using a (simple) .htaccess with "order deny,allow .. blah" won't work of course and using some php code within .htm-files won't get parsed without changes at the server-config.

Ok, there is a solution with .htaccess to limit access to single file(s) only to special users / groups.
That's working fine but it's not very comfortable...

IMO it would be better to use template.php like in other systems.

Any other (and simple) ideas?

Holger
Holger
Site Admin
 
Posts: 1547
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Protect template against direct access

Postby johnjdoe on Sat Feb 06, 2010 8:03 am

I allways put the following .htaccess in the folder /templates:

Code: Select all
<Files ~ "template.htm">
  Order allow,deny
   Deny from all
   Satisfy All
</Files>


This works fine and is simple ... ;)
johnjdoe
Co Admin
 
Posts: 646
Joined: Tue May 20, 2008 6:32 am

Re: Protect template against direct access

Postby Holger on Sat Feb 06, 2010 10:59 am

johnjdoe wrote:This works fine and is simple ... ;)
Yeah, works fine! Really simple.

Thanks,

Holger
Holger
Site Admin
 
Posts: 1547
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany

Re: Protect template against direct access

Postby leenm on Sat Feb 06, 2010 12:24 pm

Holger wrote:Yeah, works fine! Really simple.

Maybe something to add to CMSimple_XH standard templates?

Leen
leenm
 
Posts: 320
Joined: Wed Dec 09, 2009 12:33 pm
Location: Kloetinge, Netherlands

Re: Protect template against direct access

Postby Holger on Sat Feb 06, 2010 12:28 pm

leenm wrote:Maybe something to add to CMSimple_XH standard templates?

+1
You can put it in the folder /templates so it'll work with all installed templates.

Holger
Holger
Site Admin
 
Posts: 1547
Joined: Mon May 19, 2008 7:10 pm
Location: Hessen, Germany


Return to Open Development

Who is online

Users browsing this forum: No registered users and 1 guest