aboutsummaryrefslogtreecommitdiff
path: root/app/install.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2021-02-07 15:19:29 +0100
committerGravatar GitHub <noreply@github.com> 2021-02-07 15:19:29 +0100
commita626e5fff8d1cfcc7280396bd8b17b177b6345d2 (patch)
treef7ad919978822510c3006ad4e932f7093f351a56 /app/install.php
parentafc30cef3d8ca3728af35f2385d05e91e857ea0e (diff)
Check that PHP session is working during install (#3430)
* Check that PHP session is working during install #fix https://github.com/FreshRSS/FreshRSS/issues/3198 * Minor whitespace * Missing he
Diffstat (limited to 'app/install.php')
-rw-r--r--app/install.php18
1 files changed, 12 insertions, 6 deletions
diff --git a/app/install.php b/app/install.php
index 76183e3cc..366fa9a36 100644
--- a/app/install.php
+++ b/app/install.php
@@ -56,6 +56,7 @@ function saveLanguage() {
}
Minz_Session::_param('language', $_POST['language']);
+ Minz_Session::_param('sessionWorking', 'ok');
header('Location: index.php?step=1');
}
@@ -242,13 +243,13 @@ function checkStep() {
$s1 = checkRequirements();
$s2 = checkStep2();
$s3 = checkStep3();
- if (STEP > 0 && $s0['all'] != 'ok') {
+ if (STEP > 0 && $s0['all'] !== 'ok') {
header('Location: index.php?step=0');
- } elseif (STEP > 1 && $s1['all'] != 'ok') {
+ } elseif (STEP > 1 && $s1['all'] !== 'ok') {
header('Location: index.php?step=1');
- } elseif (STEP > 2 && $s2['all'] != 'ok') {
+ } elseif (STEP > 2 && $s2['all'] !== 'ok') {
header('Location: index.php?step=2');
- } elseif (STEP > 3 && $s3['all'] != 'ok') {
+ } elseif (STEP > 3 && $s3['all'] !== 'ok') {
header('Location: index.php?step=3');
}
Minz_Session::_param('actualize_feeds', true);
@@ -257,10 +258,12 @@ function checkStep() {
function checkStep0() {
$languages = Minz_Translate::availableLanguages();
$language = Minz_Session::param('language') != '' && in_array(Minz_Session::param('language'), $languages);
+ $sessionWorking = Minz_Session::param('sessionWorking') === 'ok';
return array(
'language' => $language ? 'ok' : 'ko',
- 'all' => $language ? 'ok' : 'ko'
+ 'sessionWorking' => $sessionWorking ? 'ok' : 'ko',
+ 'all' => $language && $sessionWorking ? 'ok' : 'ko'
);
}
@@ -329,9 +332,12 @@ function checkStep3() {
function printStep0() {
$actual = Minz_Translate::language();
$languages = Minz_Translate::availableLanguages();
+ $s0 = checkStep0();
?>
- <?php $s0 = checkStep0(); if ($s0['all'] == 'ok') { ?>
+ <?php if ($s0['all'] === 'ok') { ?>
<p class="alert alert-success"><span class="alert-head"><?= _t('gen.short.ok') ?></span> <?= _t('install.language.defined') ?></p>
+ <?php } else if (!empty($_POST) && $s0['sessionWorking'] !== 'ok') { ?>
+ <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('install.session.nok') ?></p>
<?php } ?>
<form action="index.php?step=0" method="post">