Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Hello,

Are there any ways to protect snippet files?
Can we use snippet with .php extension, and put somethine like "if ( !defined('K_COUCH_DIR') ) die()"
currently this is what i do,

i change my snippets to use .php extension and than i put this code inside it (in the first line)

Code: Select all
<?php if ( !defined('K_COUCH_DIR') ) die(); ?>


The snippet still work, and cannot accessed directly.

Is this OK ?
Bad Idea, <cms:show k_site_link /> does not work if i do the above.. Better stick with the .htaccess protection
Hi,

The 'couch/snippets' folder (the default location for all snippets) has a .htaccess file within containing the following directive
Code: Select all
deny from all
(If you choose to use a folder at a different location to hold the snippets, it is expected that you'll copy the .htaccess file into the new folder.)

This measure protects all contained snippets from being accessed directly so I don't think any other additional step is required to secure them.
4 posts Page 1 of 1
cron