Skip to content

Commit

Permalink
Add check for modification folder write during install.
Browse files Browse the repository at this point in the history
Close #2986
  • Loading branch information
jamesallsup committed May 18, 2015
1 parent dbfed66 commit 9121f27
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
11 changes: 8 additions & 3 deletions upload/install/controller/step_2.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ public function index() {
$data['image'] = DIR_OPENCART . 'image';
$data['image_cache'] = DIR_OPENCART . 'image/cache';
$data['image_data'] = DIR_OPENCART . 'image/catalog';
$data['modification'] = DIR_SYSTEM . 'modification';

$data['back'] = $this->url->link('step_1');

Expand Down Expand Up @@ -166,11 +167,11 @@ private function validate() {
if (!is_writable(DIR_SYSTEM . 'download')) {
$this->error['warning'] = 'Warning: Download directory needs to be writable for OpenCart to work!';
}

if (!is_writable(DIR_SYSTEM . 'upload')) {
$this->error['warning'] = 'Warning: Upload directory needs to be writable for OpenCart to work!';
}

if (!is_writable(DIR_OPENCART . 'image')) {
$this->error['warning'] = 'Warning: Image directory needs to be writable for OpenCart to work!';
}
Expand All @@ -182,7 +183,11 @@ private function validate() {
if (!is_writable(DIR_OPENCART . 'image/catalog')) {
$this->error['warning'] = 'Warning: Image catalog directory needs to be writable for OpenCart to work!';
}


if (!is_writable(DIR_SYSTEM . 'modification')) {
$this->error['warning'] = 'Warning: Modification directory needs to be writable for OpenCart to work!';
}

return !$this->error;
}
}
11 changes: 10 additions & 1 deletion upload/install/view/template/step_2.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@
<span class="text-danger"><?php echo $text_unwritable; ?></span>
<?php } ?>
</td>
</tr>
</tr>
<tr>
<td><?php echo $image . '/'; ?></td>
<td><?php if (is_writable($image)) { ?>
Expand Down Expand Up @@ -350,6 +350,15 @@
<?php } ?>
</td>
</tr>
<tr>
<td><?php echo $modification . '/'; ?></td>
<td><?php if (is_writable($modification)) { ?>
<span class="text-success"><?php echo $text_writable; ?></span>
<?php } else { ?>
<span class="text-danger"><?php echo $text_unwritable; ?></span>
<?php } ?>
</td>
</tr>
</tbody>
</table>
</fieldset>
Expand Down

0 comments on commit 9121f27

Please sign in to comment.