summaryrefslogtreecommitdiff
path: root/app/install.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-07-20 15:13:23 +0200
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-07-20 15:29:45 +0200
commite954275c06d790c2d0c163a59bff1aa30a8bd17b (patch)
tree0876365a10031787178f21ce5df7b24a69d3c6af /app/install.php
parent9ae33f4fd6938c9f9070f15babdb6fc6252c81c0 (diff)
First structure to skip steps during installation
See https://github.com/FreshRSS/FreshRSS/issues/909
Diffstat (limited to 'app/install.php')
-rw-r--r--app/install.php40
1 files changed, 39 insertions, 1 deletions
diff --git a/app/install.php b/app/install.php
index 745629aa7..6238f8a20 100644
--- a/app/install.php
+++ b/app/install.php
@@ -79,6 +79,31 @@ function saveLanguage() {
}
}
+function saveStep1() {
+ if (isset($_POST['freshrss-keep-reinstall']) &&
+ $_POST['freshrss-keep-reinstall'] === '1') {
+ // We want to keep our previous installation of FreshRSS
+ // so we need to make next steps valid by setting $_SESSION vars
+ // with values from the previous installation
+
+ // TODO: set $_SESSION vars
+ $_SESSION['title'] = '';
+ $_SESSION['old_entries'] = '';
+ $_SESSION['mail_login'] = '';
+ $_SESSION['default_user'] = '';
+
+ $_SESSION['bd_type'] = '';
+ $_SESSION['bd_host'] = '';
+ $_SESSION['bd_user'] = '';
+ $_SESSION['bd_password'] = '';
+ $_SESSION['bd_base'] = '';
+ $_SESSION['bd_prefix'] = '';
+ $_SESSION['bd_error'] = '';
+
+ header('Location: index.php?step=4');
+ }
+}
+
function saveStep2() {
$user_default_config = Minz_Configuration::get('user');
if (!empty($_POST)) {
@@ -302,6 +327,10 @@ function checkStep1() {
);
}
+function freshrss_already_installed() {
+ return false;
+}
+
function checkStep2() {
$conf = !empty($_SESSION['title']) &&
!empty($_SESSION['old_entries']) &&
@@ -537,7 +566,15 @@ function printStep1() {
<p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('install.check.http_referer.nok'); ?></p>
<?php } ?>
- <?php if ($res['all'] == 'ok') { ?>
+ <?php if (freshrss_already_installed() && $res['all'] == 'ok') { ?>
+ <p class="alert alert-warn"><span class="alert-head"><?php echo _t('gen.short.attention'); ?></span> <?php echo _t('install.check.freshrss_alreadyy_installed'); ?></p>
+
+ <form action="index.php?step=1" method="post">
+ <input type="hidden" name="freshrss-keep-reinstall" value="1" />
+ <button type="submit" class="btn btn-important" tabindex="1" ><?php echo _t('install.action.keep_install'); ?></button>
+ <a class="btn btn-attention next-step" href="?step=2" tabindex="2" ><?php echo _t('install.action.reinstall'); ?></a>
+ </form>
+ <?php } elseif ($res['all'] == 'ok') { ?>
<a class="btn btn-important next-step" href="?step=2" tabindex="1" ><?php echo _t('install.action.next_step'); ?></a>
<?php } else { ?>
<p class="alert alert-error"><?php echo _t('install.action.fix_errors_before'); ?></p>
@@ -788,6 +825,7 @@ default:
saveLanguage();
break;
case 1:
+ saveStep1();
break;
case 2:
saveStep2();