summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-25 21:46:24 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2013-12-25 21:46:24 +0100
commitd24b1e963e208a03f08b1d17ed9f319bd59a36ad (patch)
tree9355fc67ac91eca6d4ae09162a775b54bd6095c1
parent7eda2793bbc3210ae37aa66511fd7ad7661c2149 (diff)
Lancer automatiquement le raffraîchissement des flux après une mise à jour de FreshRSS
https://github.com/marienfressinaud/FreshRSS/issues/330
-rw-r--r--app/FreshRSS.php2
-rw-r--r--app/views/helpers/javascript_vars.phtml7
-rw-r--r--constants.php2
-rw-r--r--lib/Minz/Session.php30
-rw-r--r--public/install.php4
5 files changed, 25 insertions, 20 deletions
diff --git a/app/FreshRSS.php b/app/FreshRSS.php
index 90548793d..60610e352 100644
--- a/app/FreshRSS.php
+++ b/app/FreshRSS.php
@@ -1,7 +1,7 @@
<?php
class FreshRSS extends Minz_FrontController {
public function init () {
- Minz_Session::init ();
+ Minz_Session::init ('FreshRSS');
Minz_Translate::init ();
$this->loadParamsView ();
diff --git a/app/views/helpers/javascript_vars.phtml b/app/views/helpers/javascript_vars.phtml
index 0c1af45fc..d008e2e48 100644
--- a/app/views/helpers/javascript_vars.phtml
+++ b/app/views/helpers/javascript_vars.phtml
@@ -39,7 +39,8 @@
echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n";
- echo 'auto_actualize_feeds=', Minz_Session::param('actualize_feeds', false) ? 'true' : 'false', ";\n";
- if (Minz_Session::param('actualize_feeds', false)) {
- Minz_Session::_param('actualize_feeds');
+ $autoActualise = Minz_Session::param('actualize_feeds', false);
+ echo 'auto_actualize_feeds=', $autoActualise ? 'true' : 'false', ";\n";
+ if ($autoActualise) {
+ Minz_Session::_param('actualize_feeds', false);
}
diff --git a/constants.php b/constants.php
index 272647947..c22209efe 100644
--- a/constants.php
+++ b/constants.php
@@ -1,5 +1,5 @@
<?php
-define('FRESHRSS_VERSION', '0.7-beta2');
+define('FRESHRSS_VERSION', '0.7-beta3');
define('FRESHRSS_WEBSITE', 'http://freshrss.org');
// Constantes de chemins
diff --git a/lib/Minz/Session.php b/lib/Minz/Session.php
index 878caa556..c2af920df 100644
--- a/lib/Minz/Session.php
+++ b/lib/Minz/Session.php
@@ -9,21 +9,23 @@ class Minz_Session {
* $session stocke les variables de session
*/
private static $session = array ();
-
+
/**
- * Initialise la session
+ * Initialise la session, avec un nom
+ * Le nom de session est utilisé comme nom pour les cookies et les URLs (i.e. PHPSESSID).
+ * Il ne doit contenir que des caractères alphanumériques ; il doit être court et descriptif
*/
- public static function init () {
+ public static function init ($name) {
// démarre la session
- session_name (md5 (Minz_Configuration::selApplication ()));
+ session_name ($name);
session_start ();
-
+
if (isset ($_SESSION)) {
self::$session = $_SESSION;
}
}
-
-
+
+
/**
* Permet de récupérer une variable de session
* @param $p le paramètre à récupérer
@@ -35,11 +37,11 @@ class Minz_Session {
} else {
$return = $default;
}
-
+
return $return;
}
-
-
+
+
/**
* Permet de créer ou mettre à jour une variable de session
* @param $p le paramètre à créer ou modifier
@@ -59,18 +61,18 @@ class Minz_Session {
}
}
}
-
-
+
+
/**
* Permet d'effacer une session
* @param $force si à false, n'efface pas le paramètre de langue
*/
public static function unset_session ($force = false) {
$language = self::param ('language');
-
+
session_unset ();
self::$session = array ();
-
+
if (!$force) {
self::_param ('language', $language);
}
diff --git a/public/install.php b/public/install.php
index 13abb010b..ad5527765 100644
--- a/public/install.php
+++ b/public/install.php
@@ -2,7 +2,8 @@
require('../constants.php');
include(LIB_PATH . '/lib_rss.php');
-session_start ();
+session_name('FreshRSS');
+session_start();
if (isset ($_GET['step'])) {
define ('STEP', $_GET['step']);
@@ -479,6 +480,7 @@ function checkStep () {
} elseif (STEP > 3 && $s3['all'] != 'ok') {
header ('Location: index.php?step=3');
}
+ $_SESSION['actualize_feeds'] = true;
}
function checkStep0 () {
moveOldFiles() && removeOldFiles();