Browse Source

Merge remote-tracking branch 'origin/dev' into beta

Alexandre Alapetite 12 years ago
parent
commit
f52ccf7038
86 changed files with 190 additions and 122 deletions
  1. 8 0
      CHANGELOG
  2. 3 3
      README.md
  3. 3 0
      app/.htaccess
  4. 1 1
      app/Controllers/entryController.php
  5. 11 18
      app/Controllers/feedController.php
  6. 1 1
      app/FreshRSS.php
  7. 1 1
      app/Models/CategoryDAO.php
  8. 5 11
      app/Models/Configuration.php
  9. 2 5
      app/Models/Entry.php
  10. 26 13
      app/Models/Feed.php
  11. 4 2
      app/Models/FeedDAO.php
  12. 1 1
      app/actualize_script.php
  13. 2 1
      app/i18n/en.php
  14. 2 1
      app/i18n/fr.php
  15. 13 0
      app/index.html
  16. 3 3
      app/layout/nav_menu.phtml
  17. 4 3
      app/views/helpers/javascript_vars.phtml
  18. 3 0
      app/views/index/about.phtml
  19. 11 8
      constants.php
  20. 1 1
      data/index.html
  21. 3 3
      index.html
  22. 3 0
      index.php
  23. 3 0
      lib/.htaccess
  24. 1 1
      lib/Minz/Configuration.php
  25. 17 14
      lib/Minz/Session.php
  26. 9 6
      lib/Minz/Url.php
  27. 0 0
      p/.htaccess
  28. 9 2
      p/f.php
  29. 0 0
      p/favicon.ico
  30. 0 0
      p/favicon.png
  31. 1 1
      p/i/index.php
  32. 22 20
      p/i/install.php
  33. 12 0
      p/index.html
  34. 3 0
      p/index.php
  35. 0 0
      p/robots.txt
  36. 0 0
      p/scripts/global_view.js
  37. 0 0
      p/scripts/jquery-2.0.3.min.map
  38. 0 0
      p/scripts/jquery.lazyload.min.js
  39. 0 0
      p/scripts/jquery.min.js
  40. 0 0
      p/scripts/main.js
  41. 0 0
      p/scripts/shortcut.js
  42. 1 1
      p/themes/default/freshrss.css
  43. 0 0
      p/themes/default/global.css
  44. 0 0
      p/themes/default/loader.gif
  45. 0 0
      p/themes/default/metadata.json
  46. 1 1
      p/themes/flat-design/freshrss.css
  47. 0 0
      p/themes/flat-design/global.css
  48. 0 0
      p/themes/flat-design/icons/add.svg
  49. 0 0
      p/themes/flat-design/icons/all.svg
  50. 0 0
      p/themes/flat-design/icons/close.svg
  51. 0 0
      p/themes/flat-design/icons/configure.svg
  52. 0 0
      p/themes/flat-design/icons/down.svg
  53. 0 0
      p/themes/flat-design/icons/next.svg
  54. 0 0
      p/themes/flat-design/icons/prev.svg
  55. 0 0
      p/themes/flat-design/icons/refresh.svg
  56. 0 0
      p/themes/flat-design/icons/search.svg
  57. 0 0
      p/themes/flat-design/icons/up.svg
  58. 0 0
      p/themes/flat-design/loader.gif
  59. 0 0
      p/themes/flat-design/metadata.json
  60. 0 0
      p/themes/fonts/openSans.woff
  61. 0 0
      p/themes/icons/add.svg
  62. 0 0
      p/themes/icons/all.svg
  63. 0 0
      p/themes/icons/bookmark.svg
  64. 0 0
      p/themes/icons/category-white.svg
  65. 0 0
      p/themes/icons/category.svg
  66. 0 0
      p/themes/icons/close.svg
  67. 0 0
      p/themes/icons/configure.svg
  68. 0 0
      p/themes/icons/down.svg
  69. 0 0
      p/themes/icons/grey.gif
  70. 0 0
      p/themes/icons/help.svg
  71. 0 0
      p/themes/icons/icon.svg
  72. 0 0
      p/themes/icons/link.svg
  73. 0 0
      p/themes/icons/login.svg
  74. 0 0
      p/themes/icons/logout.svg
  75. 0 0
      p/themes/icons/next.svg
  76. 0 0
      p/themes/icons/non-starred.svg
  77. 0 0
      p/themes/icons/prev.svg
  78. 0 0
      p/themes/icons/read.svg
  79. 0 0
      p/themes/icons/refresh.svg
  80. 0 0
      p/themes/icons/rss.svg
  81. 0 0
      p/themes/icons/search.svg
  82. 0 0
      p/themes/icons/share.svg
  83. 0 0
      p/themes/icons/starred.svg
  84. 0 0
      p/themes/icons/tag.svg
  85. 0 0
      p/themes/icons/unread.svg
  86. 0 0
      p/themes/icons/up.svg

+ 8 - 0
CHANGELOG

@@ -51,7 +51,15 @@
 	* Tous les fichiers utilisateur sont dans “./data/” (y compris “cache”, “favicons”, et “log”)
 	* Tous les fichiers utilisateur sont dans “./data/” (y compris “cache”, “favicons”, et “log”)
 	* Déplacement de “./app/configuration/application.ini” vers “./data/config.php”
 	* Déplacement de “./app/configuration/application.ini” vers “./data/config.php”
 	* Déplacement de “./public/data/Configuration.array.php” vers “./data/*_user.php”
 	* Déplacement de “./public/data/Configuration.array.php” vers “./data/*_user.php”
+	* Déplacement de “./public/index.php” vers “./p/i/index.php” (voir cookie ci-dessous)
+	* Déplacement de “./public/” vers “./p/”
+	* Déplacement de “./actualize_script.php” vers “./app/actualize_script.php”
 * Divers :
 * Divers :
+	* Nouvelle politique de cookie de session (témoin de connexion)
+		* Utilise un nom poli “FreshRSS”
+		* Se limite au répertoire “./FreshRSS/p/i/” pour de meilleures performances HTTP
+			* Les images, CSS, scripts sont servis sans cookie
+		* utilise “HttpOnly” pour plus de sécurité
 	* Nouvel “agent utilisateur” exposé lors du téléchargement des flux, par exemple :
 	* Nouvel “agent utilisateur” exposé lors du téléchargement des flux, par exemple :
 		* “FreshRSS/0.7 (Linux; http://freshrss.org) SimplePie/1.3.1”
 		* “FreshRSS/0.7 (Linux; http://freshrss.org) SimplePie/1.3.1”
 
 

+ 3 - 3
README.md

@@ -31,7 +31,7 @@ Privilégiez pour cela des demandes sur GitHub
 
 
 # Installation
 # Installation
 1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](https://github.com/marienfressinaud/FreshRSS/archive/master.zip)
 1. Récupérez l’application FreshRSS via la commande git ou [en téléchargeant l’archive](https://github.com/marienfressinaud/FreshRSS/archive/master.zip)
-2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./public/`)
+2. Placez l’application sur votre serveur (la partie à exposer au Web est le répertoire `./p/`)
 3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/`
 3. Le serveur Web doit avoir les droits d’écriture dans le répertoire `./data/`
 4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation
 4. Accédez à FreshRSS à travers votre navigateur Web et suivez les instructions d’installation
 5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à me contacter.
 5. Tout devrait fonctionner :) En cas de problème, n’hésitez pas à me contacter.
@@ -45,11 +45,11 @@ Il est recommandé de limiter l’accès à votre FreshRSS, soit :
 # Rafraîchissement automatique des flux
 # Rafraîchissement automatique des flux
 * Vous pouvez ajouter une tâche CRON sur le script d’actualisation des flux. Par exemple, pour exécuter le script toutes les heures :
 * Vous pouvez ajouter une tâche CRON sur le script d’actualisation des flux. Par exemple, pour exécuter le script toutes les heures :
 ```
 ```
-7 * * * * php /chemin/vers/freshrss/actualize_script.php >/dev/null 2>&1
+7 * * * * php /chemin/vers/FreshRSS/app/actualize_script.php >/dev/null 2>&1
 ```
 ```
 
 
 # Conseils
 # Conseils
-* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./public` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./public`.
+* Pour une meilleure sécurité, faites en sorte que seul le répertoire `./p/` soit accessible depuis le Web, par exemple en faisant pointer un sous-domaine sur le répertoire `./p/`.
 * Les données personnelles se trouvent dans le répertoire `./data/` (déjà protégé par un .htaccess pour Apache - vérifiez que cela fonctionne -, à protéger vous-même dans le cas d’autres serveurs Web).
 * Les données personnelles se trouvent dans le répertoire `./data/` (déjà protégé par un .htaccess pour Apache - vérifiez que cela fonctionne -, à protéger vous-même dans le cas d’autres serveurs Web).
 * Le fichier `./constants.php` définit les chemins d’accès aux répertoires clés de l’application. Si vous les bougez, tout se passe ici.
 * Le fichier `./constants.php` définit les chemins d’accès aux répertoires clés de l’application. Si vous les bougez, tout se passe ici.
 * En cas de problème, les logs peuvent être utile à lire, soit depuis l’interface de FreshRSS, soit manuellement depuis `./data/log/*.log`.
 * En cas de problème, les logs peuvent être utile à lire, soit depuis l’interface de FreshRSS, soit manuellement depuis `./data/log/*.log`.

+ 3 - 0
app/.htaccess

@@ -0,0 +1,3 @@
+Order	Allow,Deny
+Deny	from all
+Satisfy	all

+ 1 - 1
app/Controllers/entryController.php

@@ -131,7 +131,7 @@ class FreshRSS_entry_Controller extends Minz_ActionController {
 				$nb = $feedDAO->cleanOldEntries($feed->id(), $date_min, $feedHistory);
 				$nb = $feedDAO->cleanOldEntries($feed->id(), $date_min, $feedHistory);
 				if ($nb > 0) {
 				if ($nb > 0) {
 					$nbTotal += $nb;
 					$nbTotal += $nb;
-					Minz_Log::record($nb . ' old entries cleaned in feed ' . $feed->id(), Minz_Log::DEBUG);
+					Minz_Log::record($nb . ' old entries cleaned in feed [' . $feed->url() . ']', Minz_Log::DEBUG);
 					$feedDAO->updateLastUpdate($feed->id());
 					$feedDAO->updateLastUpdate($feed->id());
 				}
 				}
 			}
 			}

+ 11 - 18
app/Controllers/feedController.php

@@ -20,15 +20,6 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 		$this->catDAO->checkDefault ();
 		$this->catDAO->checkDefault ();
 	}
 	}
 
 
-	private static function entryDateComparer($e1, $e2) {
-		$d1 = $e1->date(true);
-		$d2 = $e2->date(true);
-		if ($d1 === $d2) {
-			return 0;
-		}
-		return ($d1 < $d2) ? -1 : 1;
-	}
-
 	public function addAction () {
 	public function addAction () {
 		@set_time_limit(300);
 		@set_time_limit(300);
 
 
@@ -55,7 +46,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 				}
 				}
 				$feed->_httpAuth ($httpAuth);
 				$feed->_httpAuth ($httpAuth);
 
 
-				$feed->load ();
+				$feed->load(true);
 
 
 				$feedDAO = new FreshRSS_FeedDAO ();
 				$feedDAO = new FreshRSS_FeedDAO ();
 				$values = array (
 				$values = array (
@@ -91,8 +82,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 						$is_read = $this->view->conf->markUponReception() === 'yes' ? 1 : 0;
 						$is_read = $this->view->conf->markUponReception() === 'yes' ? 1 : 0;
 
 
 						$entryDAO = new FreshRSS_EntryDAO ();
 						$entryDAO = new FreshRSS_EntryDAO ();
-						$entries = $feed->entries ();
-						usort($entries, 'self::entryDateComparer');
+						$entries = array_reverse($feed->entries());	//We want chronological order and SimplePie uses reverse order
 
 
 						// on calcule la date des articles les plus anciens qu'on accepte
 						// on calcule la date des articles les plus anciens qu'on accepte
 						$nb_month_old = $this->view->conf->oldEntries ();
 						$nb_month_old = $this->view->conf->oldEntries ();
@@ -199,10 +189,9 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 		$flux_update = 0;
 		$flux_update = 0;
 		foreach ($feeds as $feed) {
 		foreach ($feeds as $feed) {
 			try {
 			try {
-				$feed->load ();
-				$feed->faviconPrepare();
-				$entries = $feed->entries ();
-				usort($entries, 'self::entryDateComparer');
+				$url = $feed->url();
+				$feed->load(false);
+				$entries = array_reverse($feed->entries());	//We want chronological order and SimplePie uses reverse order
 
 
 				$is_read = $this->view->conf->markUponReception() === 'yes' ? 1 : 0;
 				$is_read = $this->view->conf->markUponReception() === 'yes' ? 1 : 0;
 
 
@@ -231,7 +220,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 				if (($feedHistory >= 0) && (rand(0, 30) === 1)) {
 				if (($feedHistory >= 0) && (rand(0, 30) === 1)) {
 					$nb = $feedDAO->cleanOldEntries ($feed->id (), $date_min, max($feedHistory, count($entries) + 10));
 					$nb = $feedDAO->cleanOldEntries ($feed->id (), $date_min, max($feedHistory, count($entries) + 10));
 					if ($nb > 0) {
 					if ($nb > 0) {
-						Minz_Log::record ($nb . ' old entries cleaned in feed ' . $feed->id (), Minz_Log::DEBUG);
+						Minz_Log::record ($nb . ' old entries cleaned in feed [' . $feed->url() . ']', Minz_Log::DEBUG);
 					}
 					}
 				}
 				}
 
 
@@ -239,6 +228,10 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 				$feedDAO->updateLastUpdate ($feed->id ());
 				$feedDAO->updateLastUpdate ($feed->id ());
 				$feedDAO->commit ();
 				$feedDAO->commit ();
 				$flux_update++;
 				$flux_update++;
+				if ($feed->url() !== $url) {	//URL has changed (auto-discovery)
+					$feedDAO->updateFeed($feed->id(), array('url' => $feed->url()));
+				}
+				$feed->faviconPrepare();
 			} catch (FreshRSS_Feed_Exception $e) {
 			} catch (FreshRSS_Feed_Exception $e) {
 				Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE);
 				Minz_Log::record ($e->getMessage (), Minz_Log::NOTICE);
 				$feedDAO->updateLastUpdate ($feed->id (), 1);
 				$feedDAO->updateLastUpdate ($feed->id (), 1);
@@ -395,7 +388,7 @@ class FreshRSS_feed_Controller extends Minz_ActionController {
 						'type' => 'good',
 						'type' => 'good',
 						'content' => Minz_Translate::t ('feed_deleted')
 						'content' => Minz_Translate::t ('feed_deleted')
 					);
 					);
-					FreshRSS_Feed::faviconDelete($id);
+					//TODO: Delete old favicon
 				} else {
 				} else {
 					$notif = array (
 					$notif = array (
 						'type' => 'bad',
 						'type' => 'bad',

+ 1 - 1
app/FreshRSS.php

@@ -1,7 +1,7 @@
 <?php
 <?php
 class FreshRSS extends Minz_FrontController {
 class FreshRSS extends Minz_FrontController {
 	public function init () {
 	public function init () {
-		Minz_Session::init ();
+		Minz_Session::init ('FreshRSS');
 		Minz_Translate::init ();
 		Minz_Translate::init ();
 
 
 		$this->loadParamsView ();
 		$this->loadParamsView ();

+ 1 - 1
app/Models/CategoryDAO.php

@@ -90,7 +90,7 @@ class FreshRSS_CategoryDAO extends Minz_ModelPdo {
 		if ($prePopulateFeeds) {
 		if ($prePopulateFeeds) {
 			$sql = 'SELECT c.id AS c_id, c.name AS c_name, '
 			$sql = 'SELECT c.id AS c_id, c.name AS c_name, '
 			     . ($details ? 'c.color AS c_color, ' : '')
 			     . ($details ? 'c.color AS c_color, ' : '')
-			     . ($details ? 'f.* ' : 'f.id, f.name, f.website, f.priority, f.error, f.cache_nbEntries, f.cache_nbUnreads ')
+			     . ($details ? 'f.* ' : 'f.id, f.name, f.url, f.website, f.priority, f.error, f.cache_nbEntries, f.cache_nbUnreads ')
 			     . 'FROM `' . $this->prefix . 'category` c '
 			     . 'FROM `' . $this->prefix . 'category` c '
 			     . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category = c.id '
 			     . 'LEFT OUTER JOIN `' . $this->prefix . 'feed` f ON f.category = c.id '
 			     . 'GROUP BY f.id '
 			     . 'GROUP BY f.id '

+ 5 - 11
app/Models/Configuration.php

@@ -220,19 +220,13 @@ class FreshRSS_Configuration extends Minz_Model {
 	public function _sortOrder ($value) {
 	public function _sortOrder ($value) {
 		$this->sort_order = $value === 'ASC' ? 'ASC' : 'DESC';
 		$this->sort_order = $value === 'ASC' ? 'ASC' : 'DESC';
 	}
 	}
-	public function _oldEntries ($value) {
-		if (ctype_digit ($value) && $value > 0) {
-			$this->old_entries = intval($value);
-		} else {
-			$this->old_entries = 3;
-		}
+	public function _oldEntries($value) {
+		$value = intval($value);
+		$this->old_entries = $value > 0 ? $value : 3;
 	}
 	}
 	public function _keepHistoryDefault($value) {
 	public function _keepHistoryDefault($value) {
-		if (ctype_digit($value) && $value >= -1) {
-			$this->keep_history_default = intval($value);
-		} else {
-			$this->keep_history_default = 0;
-		}
+		$value = intval($value);
+		$this->keep_history_default = $value >= -1 ? $value : 0;
 	}
 	}
 	public function _shortcuts ($values) {
 	public function _shortcuts ($values) {
 		foreach ($values as $key => $value) {
 		foreach ($values as $key => $value) {

+ 2 - 5
app/Models/Entry.php

@@ -106,11 +106,8 @@ class FreshRSS_Entry extends Minz_Model {
 		$this->link = $value;
 		$this->link = $value;
 	}
 	}
 	public function _date ($value) {
 	public function _date ($value) {
-		if (ctype_digit ($value)) {
-			$this->date = intval ($value);
-		} else {
-			$this->date = time ();
-		}
+		$value = intval($value);
+		$this->date = $value > 1 ? $value : time();
 	}
 	}
 	public function _isRead ($value) {
 	public function _isRead ($value) {
 		$this->is_read = $value;
 		$this->is_read = $value;

+ 26 - 13
app/Models/Feed.php

@@ -16,6 +16,7 @@ class FreshRSS_Feed extends Minz_Model {
 	private $httpAuth = '';
 	private $httpAuth = '';
 	private $error = false;
 	private $error = false;
 	private $keep_history = -2;
 	private $keep_history = -2;
+	private $hash = null;
 
 
 	public function __construct ($url, $validate=true) {
 	public function __construct ($url, $validate=true) {
 		if ($validate) {
 		if ($validate) {
@@ -28,6 +29,14 @@ class FreshRSS_Feed extends Minz_Model {
 	public function id () {
 	public function id () {
 		return $this->id;
 		return $this->id;
 	}
 	}
+
+	public function hash() {
+		if ($this->hash === null) {
+			$this->hash = hash('crc32b', Minz_Configuration::salt() . $this->url);
+		}
+		return $this->hash;
+	}
+
 	public function url () {
 	public function url () {
 		return $this->url;
 		return $this->url;
 	}
 	}
@@ -96,7 +105,7 @@ class FreshRSS_Feed extends Minz_Model {
 		return $this->nbNotRead;
 		return $this->nbNotRead;
 	}
 	}
 	public function faviconPrepare() {
 	public function faviconPrepare() {
-		$file = DATA_PATH . '/favicons/' . $this->id () . '.txt';
+		$file = DATA_PATH . '/favicons/' . $this->hash() . '.txt';
 		if (!file_exists ($file)) {
 		if (!file_exists ($file)) {
 			$t = $this->website;
 			$t = $this->website;
 			if (empty($t)) {
 			if (empty($t)) {
@@ -105,13 +114,13 @@ class FreshRSS_Feed extends Minz_Model {
 			file_put_contents($file, $t);
 			file_put_contents($file, $t);
 		}
 		}
 	}
 	}
-	public static function faviconDelete($id) {
-		$path = DATA_PATH . '/favicons/' . $id;
+	public static function faviconDelete($hash) {
+		$path = DATA_PATH . '/favicons/' . $hash;
 		@unlink($path . '.ico');
 		@unlink($path . '.ico');
 		@unlink($path . '.txt');
 		@unlink($path . '.txt');
 	}
 	}
 	public function favicon () {
 	public function favicon () {
-		return Minz_Url::display ('/f.php?' . $this->id ());
+		return Minz_Url::display ('/f.php/' . $this->hash());
 	}
 	}
 
 
 	public function _id ($value) {
 	public function _id ($value) {
@@ -127,7 +136,8 @@ class FreshRSS_Feed extends Minz_Model {
 		$this->url = $value;
 		$this->url = $value;
 	}
 	}
 	public function _category ($value) {
 	public function _category ($value) {
-		$this->category = $value;
+		$value = intval($value);
+		$this->category = $value >= 0 ? $value : 0;
 	}
 	}
 	public function _name ($value) {
 	public function _name ($value) {
 		if (is_null ($value)) {
 		if (is_null ($value)) {
@@ -154,7 +164,8 @@ class FreshRSS_Feed extends Minz_Model {
 		$this->lastUpdate = $value;
 		$this->lastUpdate = $value;
 	}
 	}
 	public function _priority ($value) {
 	public function _priority ($value) {
-		$this->priority = ctype_digit ($value) ? intval ($value) : 10;
+		$value = intval($value);
+		$this->priority = $value >= 0 ? $value : 10;
 	}
 	}
 	public function _pathEntries ($value) {
 	public function _pathEntries ($value) {
 		$this->pathEntries = $value;
 		$this->pathEntries = $value;
@@ -172,13 +183,13 @@ class FreshRSS_Feed extends Minz_Model {
 		$this->keep_history = $value;
 		$this->keep_history = $value;
 	}
 	}
 	public function _nbNotRead ($value) {
 	public function _nbNotRead ($value) {
-		$this->nbNotRead = ctype_digit ($value) ? intval ($value) : -1;
+		$this->nbNotRead = intval($value);
 	}
 	}
 	public function _nbEntries ($value) {
 	public function _nbEntries ($value) {
-		$this->nbEntries = ctype_digit ($value) ? intval ($value) : -1;
+		$this->nbEntries = intval($value);
 	}
 	}
 
 
-	public function load () {
+	public function load ($loadDetails = false) {
 		if (!is_null ($this->url)) {
 		if (!is_null ($this->url)) {
 			if (CACHE_PATH === false) {
 			if (CACHE_PATH === false) {
 				throw new Minz_FileNotExistException (
 				throw new Minz_FileNotExistException (
@@ -250,11 +261,13 @@ class FreshRSS_Feed extends Minz_Model {
 					$this->_url ($subscribe_url);
 					$this->_url ($subscribe_url);
 				}
 				}
 
 
-				$title = htmlspecialchars(html_only_entity_decode($feed->get_title()), ENT_COMPAT, 'UTF-8');
-				$this->_name (!is_null ($title) ? $title : $this->url);
+				if ($loadDetails) {
+					$title = htmlspecialchars(html_only_entity_decode($feed->get_title()), ENT_COMPAT, 'UTF-8');
+					$this->_name (!is_null ($title) ? $title : $this->url);
 
 
-				$this->_website(html_only_entity_decode($feed->get_link()));
-				$this->_description(html_only_entity_decode($feed->get_description()));
+					$this->_website(html_only_entity_decode($feed->get_link()));
+					$this->_description(html_only_entity_decode($feed->get_description()));
+				}
 
 
 				// et on charge les articles du flux
 				// et on charge les articles du flux
 				$this->loadEntries ($feed);
 				$this->loadEntries ($feed);

+ 4 - 2
app/Models/FeedDAO.php

@@ -316,11 +316,13 @@ class FreshRSS_FeedDAO extends Minz_ModelPdo {
 				$key = $dao['id'];
 				$key = $dao['id'];
 			}
 			}
 			if ($catID === null) {
 			if ($catID === null) {
-				$catID = isset($dao['category']) ? $dao['category'] : 0;
+				$category = isset($dao['category']) ? $dao['category'] : 0;
+			} else {
+				$category = $catID ;
 			}
 			}
 
 
 			$myFeed = new FreshRSS_Feed(isset($dao['url']) ? $dao['url'] : '', false);
 			$myFeed = new FreshRSS_Feed(isset($dao['url']) ? $dao['url'] : '', false);
-			$myFeed->_category(intval($catID));
+			$myFeed->_category($category);
 			$myFeed->_name($dao['name']);
 			$myFeed->_name($dao['name']);
 			$myFeed->_website(isset($dao['website']) ? $dao['website'] : '', false);
 			$myFeed->_website(isset($dao['website']) ? $dao['website'] : '', false);
 			$myFeed->_description(isset($dao['description']) ? $dao['description'] : '');
 			$myFeed->_description(isset($dao['description']) ? $dao['description'] : '');

+ 1 - 1
actualize_script.php → app/actualize_script.php

@@ -1,5 +1,5 @@
 <?php
 <?php
-require('constants.php');
+require(dirname(__FILE__) . '/../constants.php');
 
 
 $_GET['c'] = 'feed';
 $_GET['c'] = 'feed';
 $_GET['a'] = 'actualize';
 $_GET['a'] = 'actualize';

+ 2 - 1
app/i18n/en.php

@@ -60,7 +60,7 @@ return array (
 	'access_denied'			=> 'You don’t have permission to access this page',
 	'access_denied'			=> 'You don’t have permission to access this page',
 	'page_not_found'		=> 'You are looking for a page which doesn’t exist',
 	'page_not_found'		=> 'You are looking for a page which doesn’t exist',
 	'error_occurred'		=> 'An error occurred',
 	'error_occurred'		=> 'An error occurred',
-	'error_occurred_update'		=> 'An error occurred during update',
+	'error_occurred_update'	=> 'Nothing was changed',
 
 
 	'default_category'		=> 'Uncategorized',
 	'default_category'		=> 'Uncategorized',
 	'categories_updated'		=> 'Categories have been updated',
 	'categories_updated'		=> 'Categories have been updated',
@@ -239,6 +239,7 @@ return array (
 	'freshrss_description'		=> 'FreshRSS is a RSS feeds aggregator to self-host like <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> or <a href="http://projet.idleman.fr/leed/">Leed</a>. It is light and easy to take in hand while being powerful and configurable tool.',
 	'freshrss_description'		=> 'FreshRSS is a RSS feeds aggregator to self-host like <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> or <a href="http://projet.idleman.fr/leed/">Leed</a>. It is light and easy to take in hand while being powerful and configurable tool.',
 	'credits'			=> 'Credits',
 	'credits'			=> 'Credits',
 	'credits_content'		=> 'Some design elements come from <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> although FreshRSS doesn’t use this framework. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> come from <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> font police used has been created by <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Favicons are collected with <a href="https://getfavicon.appspot.com/">getFavicon API</a>. FreshRSS is based on <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, a PHP framework.',
 	'credits_content'		=> 'Some design elements come from <a href="http://twitter.github.io/bootstrap/">Bootstrap</a> although FreshRSS doesn’t use this framework. <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">Icons</a> come from <a href="https://www.gnome.org/">GNOME project</a>. <em>Open Sans</em> font police used has been created by <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Favicons are collected with <a href="https://getfavicon.appspot.com/">getFavicon API</a>. FreshRSS is based on <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, a PHP framework.',
+	'version'			=> 'Version',
 
 
 	'logs'				=> 'Logs',
 	'logs'				=> 'Logs',
 	'logs_empty'			=> 'Log file is empty',
 	'logs_empty'			=> 'Log file is empty',

+ 2 - 1
app/i18n/fr.php

@@ -60,7 +60,7 @@ return array (
 	'access_denied'			=> 'Vous n’avez pas le droit d’accéder à cette page',
 	'access_denied'			=> 'Vous n’avez pas le droit d’accéder à cette page',
 	'page_not_found'		=> 'La page que vous cherchez n’existe pas',
 	'page_not_found'		=> 'La page que vous cherchez n’existe pas',
 	'error_occurred'		=> 'Une erreur est survenue',
 	'error_occurred'		=> 'Une erreur est survenue',
-	'error_occurred_update'		=> 'Une erreur est survenue lors de la mise à jour',
+	'error_occurred_update'	=> 'Rien n’a été modifié',
 
 
 	'default_category'		=> 'Sans catégorie',
 	'default_category'		=> 'Sans catégorie',
 	'categories_updated'		=> 'Les catégories ont été mises à jour',
 	'categories_updated'		=> 'Les catégories ont été mises à jour',
@@ -240,6 +240,7 @@ return array (
 	'freshrss_description'		=> 'FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> ou <a href="http://projet.idleman.fr/leed/">Leed</a>. Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable.',
 	'freshrss_description'		=> 'FreshRSS est un agrégateur de flux RSS à auto-héberger à l’image de <a href="http://tontof.net/kriss/feed/">Kriss Feed</a> ou <a href="http://projet.idleman.fr/leed/">Leed</a>. Il se veut léger et facile à prendre en main tout en étant un outil puissant et paramétrable.',
 	'credits'			=> 'Crédits',
 	'credits'			=> 'Crédits',
 	'credits_content'		=> 'Des éléments de design sont issus du <a href="http://twitter.github.io/bootstrap/">projet Bootstrap</a> bien que FreshRSS n’utilise pas ce framework. Les <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">icônes</a> sont issues du <a href="https://www.gnome.org/">projet GNOME</a>. La police <em>Open Sans</em> utilisée a été créée par <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Les favicons sont récupérés grâce au site <a href="https://getfavicon.appspot.com/">getFavicon</a>. FreshRSS repose sur <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, un framework PHP.',
 	'credits_content'		=> 'Des éléments de design sont issus du <a href="http://twitter.github.io/bootstrap/">projet Bootstrap</a> bien que FreshRSS n’utilise pas ce framework. Les <a href="https://git.gnome.org/browse/gnome-icon-theme-symbolic">icônes</a> sont issues du <a href="https://www.gnome.org/">projet GNOME</a>. La police <em>Open Sans</em> utilisée a été créée par <a href="https://www.google.com/webfonts/specimen/Open+Sans">Steve Matteson</a>. Les favicons sont récupérés grâce au site <a href="https://getfavicon.appspot.com/">getFavicon</a>. FreshRSS repose sur <a href="https://github.com/marienfressinaud/MINZ">Minz</a>, un framework PHP.',
+	'version'			=> 'Version',
 
 
 	'logs'				=> 'Logs',
 	'logs'				=> 'Logs',
 	'logs_empty'			=> 'Les logs sont vides',
 	'logs_empty'			=> 'Les logs sont vides',

+ 13 - 0
app/index.html

@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
+<head>
+<meta charset="UTF-8" />
+<meta http-equiv="Refresh" content="0; url=/" />
+<title>Redirection</title>
+<meta name="robots" content="noindex" />
+</head>
+
+<body>
+<p><a href="/">Redirection</a></p>
+</body>
+</html>

+ 3 - 3
app/layout/nav_menu.phtml

@@ -25,7 +25,7 @@
 			switch ($get[0]) {
 			switch ($get[0]) {
 				case 'c':
 				case 'c':
 					foreach ($this->cat_aside as $cat) {
 					foreach ($this->cat_aside as $cat) {
-						if ($cat->id () === $this->get_c) {
+						if ($cat->id () == $this->get_c) {
 							$foundCurrent = true;
 							$foundCurrent = true;
 							continue;
 							continue;
 						}
 						}
@@ -37,9 +37,9 @@
 					break;
 					break;
 				case 'f':
 				case 'f':
 					foreach ($this->cat_aside as $cat) {
 					foreach ($this->cat_aside as $cat) {
-						if ($cat->id () === $this->get_c) {
+						if ($cat->id () == $this->get_c) {
 							foreach ($cat->feeds () as $feed) {
 							foreach ($cat->feeds () as $feed) {
-								if ($feed->id () === $this->get_f) {
+								if ($feed->id () == $this->get_f) {
 									$foundCurrent = true;
 									$foundCurrent = true;
 									continue;
 									continue;
 								}
 								}

+ 4 - 3
app/views/helpers/javascript_vars.phtml

@@ -39,7 +39,8 @@
 
 
 	echo 'str_confirmation="', Minz_Translate::t('confirm_action'), '"', ",\n";
 	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);
 	}
 	}

+ 3 - 0
app/views/index/about.phtml

@@ -15,6 +15,9 @@
 
 
 		<dt><?php echo Minz_Translate::t ('license'); ?></dt>
 		<dt><?php echo Minz_Translate::t ('license'); ?></dt>
 		<dd><?php echo Minz_Translate::t ('agpl3'); ?></dd>
 		<dd><?php echo Minz_Translate::t ('agpl3'); ?></dd>
+
+		<dt><?php echo Minz_Translate::t ('version'); ?></dt>
+		<dd><?php echo FRESHRSS_VERSION; ?></dd>
 	</dl>
 	</dl>
 
 
 	<p><?php echo Minz_Translate::t ('freshrss_description'); ?></p>
 	<p><?php echo Minz_Translate::t ('freshrss_description'); ?></p>

+ 11 - 8
constants.php

@@ -1,14 +1,17 @@
 <?php
 <?php
-define('FRESHRSS_VERSION', '0.7-beta2');
+define('FRESHRSS_VERSION', '0.7-beta3');
 define('FRESHRSS_WEBSITE', 'http://freshrss.org');
 define('FRESHRSS_WEBSITE', 'http://freshrss.org');
 
 
 // Constantes de chemins
 // Constantes de chemins
-define ('FRESHRSS_PATH', dirname(__FILE__));
+define('FRESHRSS_PATH', dirname(__FILE__));
 
 
-define ('PUBLIC_PATH', FRESHRSS_PATH . '/public');
-define ('DATA_PATH', FRESHRSS_PATH . '/data');
-define ('LIB_PATH', FRESHRSS_PATH . '/lib');
-define ('APP_PATH', FRESHRSS_PATH . '/app');
+	define('PUBLIC_PATH', FRESHRSS_PATH . '/p');
+		define('INDEX_PATH', PUBLIC_PATH . '/i');
+		define('PUBLIC_RELATIVE', '..');
 
 
-define ('LOG_PATH', DATA_PATH . '/log');
-define ('CACHE_PATH', DATA_PATH . '/cache');
+	define('DATA_PATH', FRESHRSS_PATH . '/data');
+		define('LOG_PATH', DATA_PATH . '/log');
+		define('CACHE_PATH', DATA_PATH . '/cache');
+
+	define('LIB_PATH', FRESHRSS_PATH . '/lib');
+		define('APP_PATH', FRESHRSS_PATH . '/app');

+ 1 - 1
data/index.html

@@ -4,7 +4,7 @@
 <meta charset="UTF-8" />
 <meta charset="UTF-8" />
 <meta http-equiv="Refresh" content="0; url=/" />
 <meta http-equiv="Refresh" content="0; url=/" />
 <title>Redirection</title>
 <title>Redirection</title>
-<meta name="robots" content="noindex,follow" />
+<meta name="robots" content="noindex" />
 </head>
 </head>
 
 
 <body>
 <body>

+ 3 - 3
index.html

@@ -2,12 +2,12 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
 <head>
 <head>
 <meta charset="UTF-8" />
 <meta charset="UTF-8" />
-<meta http-equiv="Refresh" content="0; url=public/" />
+<meta http-equiv="Refresh" content="0; url=p/i/" />
 <title>Redirection</title>
 <title>Redirection</title>
-<meta name="robots" content="noindex,follow" />
+<meta name="robots" content="noindex" />
 </head>
 </head>
 
 
 <body>
 <body>
-<p><a href="./public/">FreshRSS</a></p>
+<p><a href="p/i/">FreshRSS</a></p>
 </body>
 </body>
 </html>
 </html>

+ 3 - 0
index.php

@@ -0,0 +1,3 @@
+<?php
+header('Location: p/i/', true, 301);
+include('index.html');

+ 3 - 0
lib/.htaccess

@@ -0,0 +1,3 @@
+Order	Allow,Deny
+Deny	from all
+Satisfy	all

+ 1 - 1
lib/Minz/Configuration.php

@@ -63,7 +63,7 @@ class Minz_Configuration {
 	/*
 	/*
 	 * Getteurs
 	 * Getteurs
 	 */
 	 */
-	public static function selApplication () {
+	public static function salt () {
 		return self::$sel_application;
 		return self::$sel_application;
 	}
 	}
 	public static function environment () {
 	public static function environment () {

+ 17 - 14
lib/Minz/Session.php

@@ -9,21 +9,24 @@ class Minz_Session {
 	 * $session stocke les variables de session
 	 * $session stocke les variables de session
 	 */
 	 */
 	private static $session = array ();
 	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
 		// démarre la session
-		session_name (md5 (Minz_Configuration::selApplication ()));
+		session_name ($name);
+		session_set_cookie_params (0, './', null, false, true);
 		session_start ();
 		session_start ();
-		
+
 		if (isset ($_SESSION)) {
 		if (isset ($_SESSION)) {
 			self::$session = $_SESSION;
 			self::$session = $_SESSION;
 		}
 		}
 	}
 	}
-	
-	
+
+
 	/**
 	/**
 	 * Permet de récupérer une variable de session
 	 * Permet de récupérer une variable de session
 	 * @param $p le paramètre à récupérer
 	 * @param $p le paramètre à récupérer
@@ -35,11 +38,11 @@ class Minz_Session {
 		} else {
 		} else {
 			$return = $default;
 			$return = $default;
 		}
 		}
-		
+
 		return $return;
 		return $return;
 	}
 	}
-	
-	
+
+
 	/**
 	/**
 	 * Permet de créer ou mettre à jour une variable de session
 	 * Permet de créer ou mettre à jour une variable de session
 	 * @param $p le paramètre à créer ou modifier
 	 * @param $p le paramètre à créer ou modifier
@@ -59,18 +62,18 @@ class Minz_Session {
 			}
 			}
 		}
 		}
 	}
 	}
-	
-	
+
+
 	/**
 	/**
 	 * Permet d'effacer une session
 	 * Permet d'effacer une session
 	 * @param $force si à false, n'efface pas le paramètre de langue
 	 * @param $force si à false, n'efface pas le paramètre de langue
 	 */
 	 */
 	public static function unset_session ($force = false) {
 	public static function unset_session ($force = false) {
 		$language = self::param ('language');
 		$language = self::param ('language');
-		
+
 		session_unset ();
 		session_unset ();
 		self::$session = array ();
 		self::$session = array ();
-		
+
 		if (!$force) {
 		if (!$force) {
 			self::_param ('language', $language);
 			self::_param ('language', $language);
 		}
 		}

+ 9 - 6
lib/Minz/Url.php

@@ -17,12 +17,16 @@ class Minz_Url {
 	 * @return l'url formatée
 	 * @return l'url formatée
 	 */
 	 */
 	public static function display ($url = array (), $encodage = 'html', $absolute = false) {
 	public static function display ($url = array (), $encodage = 'html', $absolute = false) {
-		$url = self::checkUrl ($url);
+		$isArray = is_array($url);
+
+		if ($isArray) {
+			$url = self::checkUrl ($url);
+		}
 
 
 		$url_string = '';
 		$url_string = '';
 
 
 		if ($absolute) {
 		if ($absolute) {
-			if (is_array ($url) && isset ($url['protocol'])) {
+			if ($isArray && isset ($url['protocol'])) {
 				$protocol = $url['protocol'];
 				$protocol = $url['protocol'];
 			} elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
 			} elseif (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') {
 				$protocol = 'https:';
 				$protocol = 'https:';
@@ -30,12 +34,11 @@ class Minz_Url {
 				$protocol = 'http:';
 				$protocol = 'http:';
 			}
 			}
 			$url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl ();
 			$url_string = $protocol . '//' . Minz_Request::getDomainName () . Minz_Request::getBaseUrl ();
-		}
-		else {
-			$url_string = '.';
+		} else {
+			$url_string = $isArray ? '.' : PUBLIC_RELATIVE;
 		}
 		}
 
 
-		if (is_array ($url)) {
+		if ($isArray) {
 			$router = new Minz_Router ();
 			$router = new Minz_Router ();
 
 
 			if (Minz_Configuration::useUrlRewriting ()) {
 			if (Minz_Configuration::useUrlRewriting ()) {

+ 0 - 0
public/.htaccess → p/.htaccess


+ 9 - 2
public/f.php → p/f.php

@@ -36,8 +36,15 @@ function download_favicon ($website, $dest) {
 	return true;
 	return true;
 }
 }
 
 
-$id = isset($_SERVER['QUERY_STRING']) ? $_SERVER['QUERY_STRING'] : '0';
-if (!ctype_digit($id)) {
+if (isset($_SERVER['PATH_INFO'])) {
+	$id = substr($_SERVER['PATH_INFO'], 1);
+} elseif (isset($_SERVER['QUERY_STRING'])) {
+	$id = $_SERVER['QUERY_STRING'];
+} else {
+	$id = '0';
+}
+
+if (!ctype_xdigit($id)) {
 	$id = '0';
 	$id = '0';
 }
 }
 
 

+ 0 - 0
public/favicon.ico → p/favicon.ico


+ 0 - 0
public/favicon.png → p/favicon.png


+ 1 - 1
public/index.php → p/i/index.php

@@ -21,7 +21,7 @@
 if (file_exists ('install.php')) {
 if (file_exists ('install.php')) {
 	require('install.php');
 	require('install.php');
 } else {
 } else {
-	require('../constants.php');
+	require('../../constants.php');
 
 
 	session_cache_limiter('');
 	session_cache_limiter('');
 	if (!file_exists(DATA_PATH . '/no-cache.txt')) {
 	if (!file_exists(DATA_PATH . '/no-cache.txt')) {

+ 22 - 20
public/install.php → p/i/install.php

@@ -1,8 +1,10 @@
 <?php
 <?php
-require('../constants.php');
+require('../../constants.php');
 include(LIB_PATH . '/lib_rss.php');
 include(LIB_PATH . '/lib_rss.php');
 
 
-session_start ();
+session_name('FreshRSS');
+session_set_cookie_params(0, './', null, false, true);
+session_start();
 
 
 if (isset ($_GET['step'])) {
 if (isset ($_GET['step'])) {
 	define ('STEP', $_GET['step']);
 	define ('STEP', $_GET['step']);
@@ -115,7 +117,9 @@ WHERE e1.content_bin IS NULL');
 
 
 define('SQL_CONVERT_UPDATEv006', 'UPDATE `%1$sentry` SET content_bin=COMPRESS(?) WHERE id=?;');
 define('SQL_CONVERT_UPDATEv006', 'UPDATE `%1$sentry` SET content_bin=COMPRESS(?) WHERE id=?;');
 
 
-define('SQL_UPDATE_CACHED_VALUESv006', '
+define('SQL_DROP_BACKUPv006', 'DROP TABLE IF EXISTS `%1$sentry006`, `%1$sfeed006`, `%1$scategory006`;');
+
+define('SQL_UPDATE_CACHED_VALUES', '
 UPDATE `%1$sfeed` f
 UPDATE `%1$sfeed` f
 INNER JOIN (
 INNER JOIN (
 	SELECT e.id_feed,
 	SELECT e.id_feed,
@@ -127,7 +131,7 @@ INNER JOIN (
 SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads
 SET f.cache_nbEntries=x.nbEntries, f.cache_nbUnreads=x.nbUnreads
 ');
 ');
 
 
-define('SQL_DROP_BACKUPv006', 'DROP TABLE IF EXISTS `%1$sentry006`, `%1$sfeed006`, `%1$scategory006`;');
+define('SQL_UPDATE_HISTORYv007b', 'UPDATE `%1$sfeed` SET keep_history = CASE WHEN keep_history = 0 THEN -2 WHEN keep_history = 1 THEN -1 ELSE keep_history END;');
 //</updates>
 //</updates>
 
 
 function writeLine ($f, $line) {
 function writeLine ($f, $line) {
@@ -231,6 +235,7 @@ function saveStep2 () {
 
 
 		$file_data = DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php';
 		$file_data = DATA_PATH . '/' . $_SESSION['default_user'] . '_user.php';
 
 
+		@unlink($file_data);	//To avoid access-rights problems
 		$f = fopen ($file_data, 'w');
 		$f = fopen ($file_data, 'w');
 		writeLine ($f, '<?php');
 		writeLine ($f, '<?php');
 		writeLine ($f, 'return array (');
 		writeLine ($f, 'return array (');
@@ -282,6 +287,8 @@ function saveStep3 () {
 				'prefix' => $_SESSION['bd_prefix'],
 				'prefix' => $_SESSION['bd_prefix'],
 			),
 			),
 		);
 		);
+
+		@unlink(DATA_PATH . '/config.php');	//To avoid access-rights problems
 		file_put_contents(DATA_PATH . '/config.php', "<?php\n return " . var_export($ini_array, true) . ';');
 		file_put_contents(DATA_PATH . '/config.php', "<?php\n return " . var_export($ini_array, true) . ';');
 
 
 		if (file_exists(DATA_PATH . '/config.php') && file_exists(DATA_PATH . '/application.ini')) {
 		if (file_exists(DATA_PATH . '/config.php') && file_exists(DATA_PATH . '/application.ini')) {
@@ -347,7 +354,11 @@ function updateDatabase($perform = false) {
 			$stm->execute();
 			$stm->execute();
 		}
 		}
 
 
-		$sql = sprintf(SQL_UPDATE_CACHED_VALUESv006, $_SESSION['bd_prefix_user']);
+		$sql = sprintf(SQL_UPDATE_HISTORYv007b, $_SESSION['bd_prefix_user']);
+		$stm = $c->prepare($sql);
+		$stm->execute();
+
+		$sql = sprintf(SQL_UPDATE_CACHED_VALUES, $_SESSION['bd_prefix_user']);
 		$stm = $c->prepare($sql);
 		$stm = $c->prepare($sql);
 		$stm->execute();
 		$stm->execute();
 
 
@@ -380,7 +391,7 @@ function updateDatabase($perform = false) {
 }
 }
 
 
 function deleteInstall () {
 function deleteInstall () {
-	$res = unlink (PUBLIC_PATH . '/install.php');
+	$res = unlink (INDEX_PATH . '/install.php');
 	if ($res) {
 	if ($res) {
 		header ('Location: index.php');
 		header ('Location: index.php');
 	}
 	}
@@ -454,16 +465,6 @@ function delTree($dir) {	//http://php.net/rmdir#110489
 	return rmdir($dir);
 	return rmdir($dir);
 }
 }
 
 
-function removeOldFiles() {
-	$oldDirs = array('/app/configuration/', '/cache/', '/log/', '/public/data/', '/public/themes/printer/');	//v0.6
-
-	$ok = true;
-	foreach ($oldDirs as $oldDir) {
-		$ok &= delTree(FRESHRSS_PATH . $oldDir);
-	}
-	return $ok;
-}
-
 /*** VÉRIFICATIONS ***/
 /*** VÉRIFICATIONS ***/
 function checkStep () {
 function checkStep () {
 	$s0 = checkStep0 ();
 	$s0 = checkStep0 ();
@@ -479,9 +480,10 @@ function checkStep () {
 	} elseif (STEP > 3 && $s3['all'] != 'ok') {
 	} elseif (STEP > 3 && $s3['all'] != 'ok') {
 		header ('Location: index.php?step=3');
 		header ('Location: index.php?step=3');
 	}
 	}
+	$_SESSION['actualize_feeds'] = true;
 }
 }
 function checkStep0 () {
 function checkStep0 () {
-	moveOldFiles() && removeOldFiles();
+	moveOldFiles();
 
 
 	if (file_exists(DATA_PATH . '/config.php')) {
 	if (file_exists(DATA_PATH . '/config.php')) {
 		$ini_array = include(DATA_PATH . '/config.php');
 		$ini_array = include(DATA_PATH . '/config.php');
@@ -932,7 +934,7 @@ function printStep5 () {
 
 
 function printStep6 () {
 function printStep6 () {
 ?>
 ?>
-	<p class="alert alert-error"><span class="alert-head"><?php echo _t ('oops'); ?></span> <?php echo _t ('install_not_deleted', PUBLIC_PATH . '/install.php'); ?></p>
+	<p class="alert alert-error"><span class="alert-head"><?php echo _t ('oops'); ?></span> <?php echo _t ('install_not_deleted', INDEX_PATH . '/install.php'); ?></p>
 <?php
 <?php
 }
 }
 
 
@@ -971,8 +973,8 @@ case 6:
 		<meta charset="utf-8">
 		<meta charset="utf-8">
 		<meta name="viewport" content="initial-scale=1.0">
 		<meta name="viewport" content="initial-scale=1.0">
 		<title><?php echo _t ('freshrss_installation'); ?></title>
 		<title><?php echo _t ('freshrss_installation'); ?></title>
-		<link rel="stylesheet" type="text/css" media="all" href="themes/default/global.css" />
-		<link rel="stylesheet" type="text/css" media="all" href="themes/default/freshrss.css" />
+		<link rel="stylesheet" type="text/css" media="all" href="../themes/default/global.css" />
+		<link rel="stylesheet" type="text/css" media="all" href="../themes/default/freshrss.css" />
 	</head>
 	</head>
 	<body>
 	<body>
 
 

+ 12 - 0
p/index.html

@@ -0,0 +1,12 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
+<head>
+<meta charset="UTF-8" />
+<meta http-equiv="Refresh" content="0; url=i/" />
+<title>Redirection</title>
+</head>
+
+<body>
+<p><a href="i/">FreshRSS</a></p>
+</body>
+</html>

+ 3 - 0
p/index.php

@@ -0,0 +1,3 @@
+<?php
+header('Location: i/', true, 301);
+include('index.html');

+ 0 - 0
public/robots.txt → p/robots.txt


+ 0 - 0
public/scripts/global_view.js → p/scripts/global_view.js


+ 0 - 0
public/scripts/jquery-2.0.3.min.map → p/scripts/jquery-2.0.3.min.map


+ 0 - 0
public/scripts/jquery.lazyload.min.js → p/scripts/jquery.lazyload.min.js


+ 0 - 0
public/scripts/jquery.min.js → p/scripts/jquery.min.js


+ 0 - 0
public/scripts/main.js → p/scripts/main.js


+ 0 - 0
public/scripts/shortcut.js → p/scripts/shortcut.js


+ 1 - 1
public/themes/default/freshrss.css → p/themes/default/freshrss.css

@@ -567,7 +567,7 @@
 
 
 /*** NOTIFICATION ***/
 /*** NOTIFICATION ***/
 .notification {
 .notification {
-	position: fixed;
+	position: absolute;
 	top: 10px;
 	top: 10px;
 	left: 25%; right: 25%;
 	left: 25%; right: 25%;
 	min-height: 30px;
 	min-height: 30px;

+ 0 - 0
public/themes/default/global.css → p/themes/default/global.css


+ 0 - 0
public/themes/default/loader.gif → p/themes/default/loader.gif


+ 0 - 0
public/themes/default/metadata.json → p/themes/default/metadata.json


+ 1 - 1
public/themes/flat-design/freshrss.css → p/themes/flat-design/freshrss.css

@@ -555,7 +555,7 @@ body {
 
 
 /*** NOTIFICATION ***/
 /*** NOTIFICATION ***/
 .notification {
 .notification {
-	position: fixed;
+	position: absolute;
 	top: 10px;
 	top: 10px;
 	left: 25%; right: 25%;
 	left: 25%; right: 25%;
 	min-height: 30px;
 	min-height: 30px;

+ 0 - 0
public/themes/flat-design/global.css → p/themes/flat-design/global.css


+ 0 - 0
public/themes/flat-design/icons/add.svg → p/themes/flat-design/icons/add.svg


+ 0 - 0
public/themes/flat-design/icons/all.svg → p/themes/flat-design/icons/all.svg


+ 0 - 0
public/themes/flat-design/icons/close.svg → p/themes/flat-design/icons/close.svg


+ 0 - 0
public/themes/flat-design/icons/configure.svg → p/themes/flat-design/icons/configure.svg


+ 0 - 0
public/themes/flat-design/icons/down.svg → p/themes/flat-design/icons/down.svg


+ 0 - 0
public/themes/flat-design/icons/next.svg → p/themes/flat-design/icons/next.svg


+ 0 - 0
public/themes/flat-design/icons/prev.svg → p/themes/flat-design/icons/prev.svg


+ 0 - 0
public/themes/flat-design/icons/refresh.svg → p/themes/flat-design/icons/refresh.svg


+ 0 - 0
public/themes/flat-design/icons/search.svg → p/themes/flat-design/icons/search.svg


+ 0 - 0
public/themes/flat-design/icons/up.svg → p/themes/flat-design/icons/up.svg


+ 0 - 0
public/themes/flat-design/loader.gif → p/themes/flat-design/loader.gif


+ 0 - 0
public/themes/flat-design/metadata.json → p/themes/flat-design/metadata.json


+ 0 - 0
public/themes/fonts/openSans.woff → p/themes/fonts/openSans.woff


+ 0 - 0
public/themes/icons/add.svg → p/themes/icons/add.svg


+ 0 - 0
public/themes/icons/all.svg → p/themes/icons/all.svg


+ 0 - 0
public/themes/icons/bookmark.svg → p/themes/icons/bookmark.svg


+ 0 - 0
public/themes/icons/category-white.svg → p/themes/icons/category-white.svg


+ 0 - 0
public/themes/icons/category.svg → p/themes/icons/category.svg


+ 0 - 0
public/themes/icons/close.svg → p/themes/icons/close.svg


+ 0 - 0
public/themes/icons/configure.svg → p/themes/icons/configure.svg


+ 0 - 0
public/themes/icons/down.svg → p/themes/icons/down.svg


+ 0 - 0
public/themes/icons/grey.gif → p/themes/icons/grey.gif


+ 0 - 0
public/themes/icons/help.svg → p/themes/icons/help.svg


+ 0 - 0
public/themes/icons/icon.svg → p/themes/icons/icon.svg


+ 0 - 0
public/themes/icons/link.svg → p/themes/icons/link.svg


+ 0 - 0
public/themes/icons/login.svg → p/themes/icons/login.svg


+ 0 - 0
public/themes/icons/logout.svg → p/themes/icons/logout.svg


+ 0 - 0
public/themes/icons/next.svg → p/themes/icons/next.svg


+ 0 - 0
public/themes/icons/non-starred.svg → p/themes/icons/non-starred.svg


+ 0 - 0
public/themes/icons/prev.svg → p/themes/icons/prev.svg


+ 0 - 0
public/themes/icons/read.svg → p/themes/icons/read.svg


+ 0 - 0
public/themes/icons/refresh.svg → p/themes/icons/refresh.svg


+ 0 - 0
public/themes/icons/rss.svg → p/themes/icons/rss.svg


+ 0 - 0
public/themes/icons/search.svg → p/themes/icons/search.svg


+ 0 - 0
public/themes/icons/share.svg → p/themes/icons/share.svg


+ 0 - 0
public/themes/icons/starred.svg → p/themes/icons/starred.svg


+ 0 - 0
public/themes/icons/tag.svg → p/themes/icons/tag.svg


+ 0 - 0
public/themes/icons/unread.svg → p/themes/icons/unread.svg


+ 0 - 0
public/themes/icons/up.svg → p/themes/icons/up.svg