diff options
| author | 2014-01-05 21:55:15 +0100 | |
|---|---|---|
| committer | 2014-01-05 21:55:15 +0100 | |
| commit | 70c6ba903d9c69adda173917b07e503df07ae591 (patch) | |
| tree | 34efb3ee2fd255c393d732350c6dc8c775eed338 /p/i | |
| parent | eb8c4d21af44430390d02d1557950b38352581d3 (diff) | |
Meilleure mise-à-jour avec Persona depuis v0.6 vers v0.7
https://github.com/marienfressinaud/FreshRSS/issues/347
* Conserve l'information sur l'utilisation de Persona lors d'une mise à
jour depuis v0.6 vers v0.7.
* Idem pour la lecture anonyme
* Les droits sur le répertoire persona sont testés
* Les tokens ne sont pas migrés ni testés pour l'instant
https://github.com/marienfressinaud/FreshRSS/issues/327
Diffstat (limited to 'p/i')
| -rw-r--r-- | p/i/install.php | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/p/i/install.php b/p/i/install.php index 4f2d00848..cd15c35f4 100644 --- a/p/i/install.php +++ b/p/i/install.php @@ -213,6 +213,8 @@ function saveStep3 () { 'base_url' => '', 'title' => $_SESSION['title'], 'default_user' => $_SESSION['default_user'], + 'auth_type' => $_SESSION['auth_type'], + 'allow_anonymous' => $_SESSION['allow_anonymous'], ), 'db' => array( 'type' => $_SESSION['bd_type'], @@ -433,7 +435,7 @@ function checkStep0 () { if ($ini_array) { $ini_general = isset($ini_array['general']) ? $ini_array['general'] : null; if ($ini_general) { - $keys = array('environment', 'salt', 'title', 'default_user'); + $keys = array('environment', 'salt', 'title', 'default_user', 'allow_anonymous', 'auth_type'); foreach ($keys as $key) { if ((empty($_SESSION[$key])) && isset($ini_general[$key])) { $_SESSION[$key] = $ini_general[$key]; @@ -455,6 +457,12 @@ function checkStep0 () { $userConfig = include(DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php'); } elseif (file_exists(DATA_PATH . '/Configuration.array.php')) { $userConfig = include(DATA_PATH . '/Configuration.array.php'); //v0.6 + if (empty($_SESSION['auth_type'])) { + $_SESSION['auth_type'] = empty($userConfig['mail_login']) ? 'none' : 'persona'; + } + if (!isset($_SESSION['allow_anonymous'])) { + $_SESSION['allow_anonymous'] = empty($userConfig['anon_access']) ? false : ($userConfig['anon_access'] === 'yes'); + } } else { $userConfig = array(); } @@ -487,6 +495,7 @@ function checkStep1 () { $cache = CACHE_PATH && is_writable (CACHE_PATH); $log = LOG_PATH && is_writable (LOG_PATH); $favicons = is_writable (DATA_PATH . '/favicons'); + $persona = is_writable (DATA_PATH . '/persona'); return array ( 'php' => $php ? 'ok' : 'ko', @@ -500,7 +509,8 @@ function checkStep1 () { 'cache' => $cache ? 'ok' : 'ko', 'log' => $log ? 'ok' : 'ko', 'favicons' => $favicons ? 'ok' : 'ko', - 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && $data && $cache && $log && $favicons ? 'ok' : 'ko' + 'persona' => $persona ? 'ok' : 'ko', + 'all' => $php && $minz && $curl && $pdo && $pcre && $ctype && $dom && $data && $cache && $log && $favicons && $persona ? 'ok' : 'ko' ); } @@ -710,6 +720,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 . '/favicons'); ?></p> <?php } ?> + <?php if ($res['persona'] == 'ok') { ?> + <p class="alert alert-success"><span class="alert-head"><?php echo _t ('ok'); ?></span> <?php echo _t ('persona_is_ok'); ?></p> + <?php } else { ?> + <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['all'] == 'ok') { ?> <a class="btn btn-important next-step" href="?step=2"><?php echo _t ('next_step'); ?></a> <?php } else { ?> |
