<?php

if (!defined('UPGRADE_RUN')) { exit; }

/* UPGRADE - FIXES / DIRECTORY CHANGES
------------------------------------------------------*/

// Check if index files exist in certain directories..
foreach (array(
  GPATH . 'admin/backup',
  GPATH . 'logs'
) AS $l_dirs) {
  if (is_dir($l_dirs) && is_writeable($l_dirs)) {
    if (!file_exists($l_dirs . '/index.html')) {
      mswPUT($l_dirs . '/index.html', 'Access Denied');
      if (file_exists($l_dirs . '/index.html')) {
        mswUpLog('Index file added to: ' . $l_dirs, 'instruction');
      } else {
        mswUpLog('Index file could NOT be added to: ' . $l_dirs . '. Possible permissions issue', 'instruction');
      }
    } else {
      mswUpLog('Index file already exists in: ' . $l_dirs, 'instruction');
    }
  } else {
    mswUpLog('Directory does not exist or is not writeable: ' . $l_dirs, 'instruction');
  }
}

?>