<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>Contao Check <?php echo CONTAO_CHECK_VERSION ?></title>
  <link rel="stylesheet" href="assets/style.css">
</head>
<body>
<div id="wrapper">
  <h1>Contao Check <?php echo CONTAO_CHECK_VERSION ?></h1>
  <div class="row">
    <h2><?php echo _('File permissions') ?></2>
  </div>
  <div class="row">
    <h3><?php echo _('php.ini settings') ?></h3>
    <?php if (!$this->hasSafeMode()): ?>
      <p class="confirm"><?php echo _('The PHP safe_mode is not enabled.') ?></p>
    <?php else: ?>
      <p class="error"><?php echo _('The PHP safe_mode is enabled.') ?></p>
      <p class="explain"><?php echo _('It is recommended to disable the safe_mode in your php.ini or server control panel, otherwise the PHP process it not allowed to create or manipulate files and Contao cannot work properly.') ?></p>
    <?php endif; ?>
  </div>
  <div class="row">
    <h3><?php echo _('Creating a test folder') ?></h3>
    <?php if ($this->canCreateFolder()): ?>
      <p class="confirm"><?php printf(_('The test folder could be created (owner: %s, chmod: %s).'), $this->getFolderOwner(), $this->getTestFolderChmod()) ?></p>
    <?php elseif ($this->getTestFolderChmod() === null): ?>
      <p class="error"><?php echo _('The test folder could not be created.') ?></p>
      <p class="explain"><?php echo _('It seems that the PHP process does not have enough permissions to create folders on your server.') ?></p>
    <?php else: ?>
      <p class="error"><?php echo _('The test folder does not have the correct owner or chmod settings.') ?></p>
      <p class="explain"><?php printf(_('The test folder is owned by %s (should be %s) and has the chmod settings %s (should be %s).'), $this->getTestFolderOwner(), $this->getFolderOwner(), $this->getTestFolderChmod(), (IS_WINDOWS ? '777' : _('775, 755, 770 or 750'))) ?></p>
    <?php endif; ?>
  </div>
  <div class="row">
    <h3><?php echo _('Creating a test file') ?></h3>
    <?php if ($this->canCreateFile()): ?>
      <p class="confirm"><?php printf(_('The test file could be created (owner: %s, chmod: %s).'), $this->getFileOwner(), $this->getTestFileChmod()) ?></p>
    <?php elseif ($this->getTestFileChmod() === null): ?>
      <p class="error"><?php echo _('The test file could not be created.') ?></p>
      <p class="explain"><?php echo _('It seems that the PHP process does not have enough permissions to create files on your server.') ?></p>
    <?php else: ?>
      <p class="error"><?php echo _('The test file does not have the correct owner or chmod settings.') ?></p>
      <p class="explain"><?php printf(_('The test file is owned by %s (should be %s) and has the chmod settings %s (should be %s).'), $this->getTestFileOwner(), $this->getFileOwner(), $this->getTestFileChmod(), (IS_WINDOWS ? '666' : _('664, 644, 660 or 640'))) ?></p>
    <?php endif; ?>
  </div>
  <div class="row">
    <?php if (!$this->failed()): ?>
      <p class="confirm large"><?php echo _('The PHP process is allowed to create files on this server.') ?></p>
    <?php else: ?>
      <p class="error large"><?php echo _('The PHP process is not allowed to create files on this server.') ?></p>
    <?php endif; ?>
  </div>
  <p class="back"><a href="./"><?php echo _('Go back') ?></a></p>
</div>
</body>
</html>