From 031df528b611a5c6639c0d86636633da098d8aa2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicolas=20L=C5=93uillet?=
Date: Mon, 7 Oct 2013 13:19:34 +0200
Subject: [PATCH] bug fix #268: move POCHE_VERSION in index.php and change the
name to avoid conflicts when updating
---
inc/poche/Poche.class.php | 4 +-
inc/poche/config.inc.php.new | 2 -
index.php | 1 +
install/update_sqlite_from_0_to_1.php | 72 ------------------------
install/update_to_1beta3.php | 79 ---------------------------
themes/default/_footer.twig | 2 +-
themes/default/config.twig | 4 +-
7 files changed, 6 insertions(+), 158 deletions(-)
delete mode 100644 install/update_sqlite_from_0_to_1.php
delete mode 100644 install/update_to_1beta3.php
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index 899d73567..245f6a138 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -366,8 +366,8 @@ class Poche
case 'config':
$dev = $this->getPocheVersion('dev');
$prod = $this->getPocheVersion('prod');
- $compare_dev = version_compare(POCHE_VERSION, $dev);
- $compare_prod = version_compare(POCHE_VERSION, $prod);
+ $compare_dev = version_compare(POCHE, $dev);
+ $compare_prod = version_compare(POCHE, $prod);
$themes = $this->getInstalledThemes();
$tpl_vars = array(
'themes' => $themes,
diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new
index 255b97e6c..99223c785 100755
--- a/inc/poche/config.inc.php.new
+++ b/inc/poche/config.inc.php.new
@@ -49,8 +49,6 @@ define ('CACHE', ROOT . '/cache');
define ('PAGINATION', '10');
-define ('POCHE_VERSION', '1.0.0');
-
define ('POCKET_FILE', '/ril_export.html');
define ('READABILITY_FILE', '/readability');
define ('INSTAPAPER_FILE', '/instapaper-export.html');
diff --git a/index.php b/index.php
index f1953c2cc..22696c6fd 100644
--- a/index.php
+++ b/index.php
@@ -8,6 +8,7 @@
* @license http://www.wtfpl.net/ see COPYING file
*/
+define ('POCHE', '1.0.0');
require_once 'inc/poche/global.inc.php';
# Start Poche
diff --git a/install/update_sqlite_from_0_to_1.php b/install/update_sqlite_from_0_to_1.php
deleted file mode 100644
index 299abf48d..000000000
--- a/install/update_sqlite_from_0_to_1.php
+++ /dev/null
@@ -1,72 +0,0 @@
-setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
-
-# Requêtes à exécuter pour mettre à jour poche.sqlite en 1.x
-
-# ajout d'un champ user_id sur la table entries
-$sql = 'ALTER TABLE entries RENAME TO tempEntries;';
-$query = $handle->prepare($sql);
-$query->execute();
-
-$sql = 'CREATE TABLE entries (id INTEGER PRIMARY KEY, title TEXT, url TEXT, is_read NUMERIC DEFAULT 0, is_fav NUMERIC DEFAULT 0, content BLOB, user_id NUMERIC);';
-$query = $handle->prepare($sql);
-$query->execute();
-
-$sql = 'INSERT INTO entries (id, title, url, is_read, is_fav, content) SELECT id, title, url, is_read, is_fav, content FROM tempEntries;';
-$query = $handle->prepare($sql);
-$query->execute();
-
-# Update tout pour mettre user_id = 1
-$sql = 'UPDATE entries SET user_id = 1;';
-$query = $handle->prepare($sql);
-$query->execute();
-
-# Changement des flags pour les lus / favoris
-$sql = 'UPDATE entries SET is_read = 1 WHERE is_read = -1;';
-$query = $handle->prepare($sql);
-$query->execute();
-
-$sql = 'UPDATE entries SET is_fav = 1 WHERE is_fav = -1;';
-$query = $handle->prepare($sql);
-$query->execute();
-
-# Création de la table users
-$sql = 'CREATE TABLE users (id INTEGER PRIMARY KEY, username TEXT, password TEXT, name TEXT, email TEXT);';
-$query = $handle->prepare($sql);
-$query->execute();
-
-$sql = 'INSERT INTO users (username) SELECT value FROM config WHERE name = "login";';
-$query = $handle->prepare($sql);
-$query->execute();
-
-$sql = "UPDATE users SET password = (SELECT value FROM config WHERE name = 'password')";
-$query = $handle->prepare($sql);
-$query->execute();
-
-# Création de la table users_config
-$sql = 'CREATE TABLE users_config (id INTEGER PRIMARY KEY, user_id NUMERIC, name TEXT, value TEXT);';
-$query = $handle->prepare($sql);
-$query->execute();
-
-$sql = 'INSERT INTO users_config (user_id, name, value) VALUES (1, "pager", "10");';
-$query = $handle->prepare($sql);
-$query->execute();
-
-$sql = 'INSERT INTO users_config (user_id, name, value) VALUES (1, "language", "en_EN.UTF8");';
-$query = $handle->prepare($sql);
-$query->execute();
-
-# Suppression de la table temporaire
-$sql = 'DROP TABLE tempEntries;';
-$query = $handle->prepare($sql);
-$query->execute();
-
-# Vidage de la table de config
-$sql = 'DELETE FROM config;';
-$query = $handle->prepare($sql);
-$query->execute();
-
-echo 'welcome to poche 1.0 !';
\ No newline at end of file
diff --git a/install/update_to_1beta3.php b/install/update_to_1beta3.php
deleted file mode 100644
index e0da1590d..000000000
--- a/install/update_to_1beta3.php
+++ /dev/null
@@ -1,79 +0,0 @@
-
-
-
-
-
-
-
-
-
- updating poche
-
-
- update poche to 1.0-beta3
-
- Changelog
-
-
- - this awesome updating step
- - error message when install folder exists
- - more tests before installation (write access, etc.)
- - updated README to make installation easier
- - german language thanks to HLFH
- - spanish language thanks to Nitche
- - new file ./inc/poche/myconfig.inc.php created to store language and salt
- - #119: salt is now created when installing poche
- - #130: robots.txt added
- - #136: error during readability import
- - #137: mixed content alert in https
- - #138: change pattern to parse url with #
-
-
- To update your poche, please fill the following fields.
-
-
-
-login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . $old_salt));
- if ($user != array()) {
- $new_salt = md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand());
- $myconfig_file = '../inc/poche/myconfig.inc.php';
- if (!is_writable('../inc/poche/')) {
- die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.');
- }
-
- if (!file_exists($myconfig_file))
- {
- $fp = fopen($myconfig_file, 'w');
-
- fwrite($fp, 'updatePassword($user['id'], sha1($_POST['password'] . $_POST['login'] . $new_salt));
-?>
- your poche is up to date!
- don't forget to delete ./install/ folder after the update.
- go back to your poche
-
-
-
\ No newline at end of file
diff --git a/themes/default/_footer.twig b/themes/default/_footer.twig
index 2b8958549..06148a57c 100644
--- a/themes/default/_footer.twig
+++ b/themes/default/_footer.twig
@@ -1,4 +1,4 @@
\ No newline at end of file
diff --git a/themes/default/config.twig b/themes/default/config.twig
index 0f1aea80b..af8ff8ca7 100644
--- a/themes/default/config.twig
+++ b/themes/default/config.twig
@@ -5,7 +5,7 @@
{% include '_menu.twig' %}
{% endblock %}
{% block content %}
- {% trans "Poching a link" %}
+ {% trans "Poching a link" %}
F
{% trans "You can poche a link by several methods:" %} (?)