aboutsummaryrefslogtreecommitdiffstats
path: root/include/template.class.php
diff options
context:
space:
mode:
authorrvelices <rv-github@modusoptimus.com>2008-09-04 01:28:34 +0000
committerrvelices <rv-github@modusoptimus.com>2008-09-04 01:28:34 +0000
commitefa741187507b388476da9d9a8694c3602479e7c (patch)
tree01242504f325d8c97cb77afeca8f193ca288d147 /include/template.class.php
parent4002f708e1b701a800b3d6968d12ab9a49c2d071 (diff)
- bug 854: better checks of directory creations ( local_data_dir, templates_c, tmp etc...)
git-svn-id: http://piwigo.org/svn/trunk@2497 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/template.class.php')
-rw-r--r--include/template.class.php23
1 files changed, 3 insertions, 20 deletions
diff --git a/include/template.class.php b/include/template.class.php
index c2dc8cc07..dfe1562a3 100644
--- a/include/template.class.php
+++ b/include/template.class.php
@@ -53,25 +53,8 @@ class Template {
$this->smarty = new Smarty;
$this->smarty->debugging = $conf['debug_template'];
- if ( isset($conf['compiled_template_dir'] ) )
- {
- $compile_dir = $conf['compiled_template_dir'];
- }
- else
- {
- $compile_dir = $conf['local_data_dir'];
- if ( !is_dir($compile_dir) )
- {
- mkdir( $compile_dir, 0777);
- file_put_contents($compile_dir.'/index.htm', '');
- }
- $compile_dir .= '/templates_c';
- }
- if ( !is_dir($compile_dir) )
- {
- mkdir( $compile_dir, 0777 );
- file_put_contents($compile_dir.'/index.htm', '');
- }
+ $compile_dir = $conf['local_data_dir'].'/templates_c';
+ mkgetdir( $compile_dir );
$this->smarty->compile_dir = $compile_dir;
@@ -123,7 +106,7 @@ class Template {
$this->smarty->compile_id = null;
$this->smarty->clear_compiled_tpl();
$this->smarty->compile_id = $save_compile_id;
- file_put_contents($this->smarty->compile_dir.'/index.htm', '');
+ file_put_contents($this->smarty->compile_dir.'/index.htm', 'Not allowed!');
}
function get_themeconf($val)