aboutsummaryrefslogtreecommitdiff
path: root/app/install.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-17 14:07:52 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2014-09-17 14:07:52 +0200
commit75bf305b2f084958d43689b3781d03a29cc21f60 (patch)
treeb700e12f1a5b1e847d2ad485295e5355a6031904 /app/install.php
parent3b8c381689334a15e7c034425f8615860dc3fa13 (diff)
Test HTTP REFERER in install.php
Test is actually basic, we need to use Minz_Request::isRefererFromSameDomain() method to improve checking
Diffstat (limited to 'app/install.php')
-rw-r--r--app/install.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/app/install.php b/app/install.php
index 8986e9965..f31764545 100644
--- a/app/install.php
+++ b/app/install.php
@@ -307,6 +307,7 @@ function checkStep1() {
$log = LOG_PATH && is_writable(LOG_PATH);
$favicons = is_writable(DATA_PATH . '/favicons');
$persona = is_writable(DATA_PATH . '/persona');
+ $http_referer = !empty($_SERVER['HTTP_REFERER']);
return array(
'php' => $php ? 'ok' : 'ko',
@@ -323,8 +324,10 @@ function checkStep1() {
'log' => $log ? 'ok' : 'ko',
'favicons' => $favicons ? 'ok' : 'ko',
'persona' => $persona ? 'ok' : 'ko',
+ 'http_referer' => $http_referer ? 'ok' : 'ko',
'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom &&
- $data && $cache && $log && $favicons && $persona ? 'ok' : 'ko'
+ $data && $cache && $log && $favicons && $persona && $http_referer ?
+ 'ok' : 'ko'
);
}
@@ -548,6 +551,12 @@ function printStep1() {
<p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('file_is_nok', DATA_PATH . '/persona'); ?></p>
<?php } ?>
+ <?php if ($res['http_referer'] == 'ok') { ?>
+ <p class="alert alert-success"><span class="alert-head"><?php echo _t('ok'); ?></span> <?php echo _t('http_referer_is_ok'); ?></p>
+ <?php } else { ?>
+ <p class="alert alert-error"><span class="alert-head"><?php echo _t('damn'); ?></span> <?php echo _t('http_referer_is_nok'); ?></p>
+ <?php } ?>
+
<?php if ($res['all'] == 'ok') { ?>
<a class="btn btn-important next-step" href="?step=2"><?php echo _t('next_step'); ?></a>
<?php } else { ?>