From efa741187507b388476da9d9a8694c3602479e7c Mon Sep 17 00:00:00 2001 From: rvelices Date: Thu, 4 Sep 2008 01:28:34 +0000 Subject: - 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 --- include/template.class.php | 23 +++-------------------- 1 file changed, 3 insertions(+), 20 deletions(-) (limited to 'include/template.class.php') 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) -- cgit v1.2.3