From c3b12c425ce1dfc244fc9071ad955c4395be7068 Mon Sep 17 00:00:00 2001 From: Karsten Heiken Date: Thu, 4 Aug 2011 17:24:08 +0200 Subject: [PATCH] Fix creation of new trial directories --- application/controllers/trials.php | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/application/controllers/trials.php b/application/controllers/trials.php index 6af1cd2..4075f25 100644 --- a/application/controllers/trials.php +++ b/application/controllers/trials.php @@ -88,15 +88,18 @@ class Trials extends CI_Controller { $userpath = FCPATH . 'uploads/' . $this->session->userdata('user_id') . '/'; $projectpath = $userpath . $data['project_id'] . '/'; $trialpath = $projectpath . $data['trial_id'] . '/'; - if(!is_dir($trialpath)) - if (!is_dir($projectpath)) - if(!is_dir($userpath)) + if(!is_dir($trialpath)) { + if (!is_dir($projectpath)) { + if(!is_dir($userpath)) { mkdir($userpath); + chmod($userpath, 0777); + } mkdir($projectpath); + chmod($projectpath, 0777); + } mkdir($trialpath); - chmod($userpath, 0777); - chmod($projectpath, 0777); - chmod($trialpath, 0777); + chmod($trialpath, 0777); + } redirect('/trial/detail/' . $result, 'refresh'); } else {