aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.travis.yml15
-rw-r--r--COPYING.md (renamed from COPYING)0
-rw-r--r--CREDITS.md (renamed from CREDITS)0
-rw-r--r--TODO.md16
-rw-r--r--inc/poche/Poche.class.php6
-rw-r--r--inc/poche/Tools.class.php4
-rwxr-xr-xinstall/poche.sqlitebin360448 -> 360448 bytes
-rw-r--r--install/update.php56
-rw-r--r--install/update_to_1beta3.php79
-rw-r--r--phpunit.xml.dist0
-rw-r--r--tpl/config.twig18
-rw-r--r--tpl/error.twig5
-rw-r--r--tpl/layout.twig2
13 files changed, 128 insertions, 73 deletions
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index 9d6ba132..00000000
--- a/.travis.yml
+++ /dev/null
@@ -1,15 +0,0 @@
1language: php
2
3php:
4 - 5.4
5
6branches:
7 only:
8 - dev
9
10before_script:
11 - composer install
12
13notifications:
14 email:
15 - nicolas.loeuillet@gmail.com \ No newline at end of file
diff --git a/COPYING b/COPYING.md
index ee7d6a54..ee7d6a54 100644
--- a/COPYING
+++ b/COPYING.md
diff --git a/CREDITS b/CREDITS.md
index a6dedce4..a6dedce4 100644
--- a/CREDITS
+++ b/CREDITS.md
diff --git a/TODO.md b/TODO.md
index ac3c0e98..fdba2a51 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,11 +1,9 @@
1# TODO 1# TODO
2 2
3pouvoir annuler la suppression 3* pouvoir annuler la suppression
4conventions codage ? phing ? vérifier error_log qui trainent 4* conventions codage ? phing ? vérifier error_log qui trainent
5phpDocumentor 5* phpDocumentor
6minifier css 6* minifier css
7revoir tous les css 7* barre fixe d'admin sur la page d'un billet ?
8barre fixe d'admin sur la page d'un billet ? 8* revoir export (export vers pocket &cie ? )
9revoir export (export vers pocket &cie ? ) 9* raccourcis clavier \ No newline at end of file
10raccourcis clavier
11date d'ajout d'un lien \ No newline at end of file
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php
index e0dc0d20..4832f816 100644
--- a/inc/poche/Poche.class.php
+++ b/inc/poche/Poche.class.php
@@ -47,16 +47,16 @@ class Poche
47 die('You don\'t have write access on cache directory.'); 47 die('You don\'t have write access on cache directory.');
48 } 48 }
49 else if (file_exists('./install/update.php') && !DEBUG_POCHE) { 49 else if (file_exists('./install/update.php') && !DEBUG_POCHE) {
50 $msg = 'A poche update is needed. Please execute this update <a href="install/update.php">by clicking here</a>. If you have already do the update, please delete /install folder.'; 50 $msg = '<h1>setup</h1><p><strong>It\'s your first time here?</strong> Please copy /install/poche.sqlite in db folder. Then, delete install folder.<br /><strong>If you have already installed poche</strong>, an update is needed <a href="install/update.php">by clicking here</a>.</p>';
51 $allIsGood = FALSE; 51 $allIsGood = FALSE;
52 } 52 }
53 else if (file_exists('./install') && !DEBUG_POCHE) { 53 else if (file_exists('./install') && !DEBUG_POCHE) {
54 $msg = 'If you want to update your poche, you just have to delete /install folder. <br />To install your poche with sqlite, copy /install/poche.sqlite in /db and delete the folder /install. you have to delete the /install folder before using poche.'; 54 $msg = '<h1>setup</h1><p><strong>If you want to update your poche</strong>, you just have to delete /install folder. <br /><strong>To install your poche with sqlite</strong>, copy /install/poche.sqlite in /db and delete the folder /install. you have to delete the /install folder before using poche.</p>';
55 $allIsGood = FALSE; 55 $allIsGood = FALSE;
56 } 56 }
57 else if (STORAGE == 'sqlite' && !is_writable(STORAGE_SQLITE)) { 57 else if (STORAGE == 'sqlite' && !is_writable(STORAGE_SQLITE)) {
58 Tools::logm('you don\'t have write access on sqlite file'); 58 Tools::logm('you don\'t have write access on sqlite file');
59 $msg = 'You don\'t have write access on sqlite file.'; 59 $msg = '<h1>error</h1><p>You don\'t have write access on sqlite file.</p>';
60 $allIsGood = FALSE; 60 $allIsGood = FALSE;
61 } 61 }
62 62
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php
index 52d0f2d5..8661ab6e 100644
--- a/inc/poche/Tools.class.php
+++ b/inc/poche/Tools.class.php
@@ -238,7 +238,7 @@ class Tools
238 public static function createMyConfig() 238 public static function createMyConfig()
239 { 239 {
240 $myconfig_file = './inc/poche/myconfig.inc.php'; 240 $myconfig_file = './inc/poche/myconfig.inc.php';
241 241
242 if (!is_writable('./inc/poche/')) { 242 if (!is_writable('./inc/poche/')) {
243 self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php'); 243 self::logm('you don\'t have write access to create ./inc/poche/myconfig.inc.php');
244 die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); 244 die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.');
@@ -248,7 +248,7 @@ class Tools
248 { 248 {
249 $fp = fopen($myconfig_file, 'w'); 249 $fp = fopen($myconfig_file, 'w');
250 fwrite($fp, '<?php'."\r\n"); 250 fwrite($fp, '<?php'."\r\n");
251 fwrite($fp, "define ('POCHE_VERSION', '1.0-beta3');" . "\r\n"); 251 fwrite($fp, "define ('POCHE_VERSION', '1.0-beta4');" . "\r\n");
252 fwrite($fp, "define ('SALT', '" . md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand()) . "');" . "\r\n"); 252 fwrite($fp, "define ('SALT', '" . md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand()) . "');" . "\r\n");
253 fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n"); 253 fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n");
254 fclose($fp); 254 fclose($fp);
diff --git a/install/poche.sqlite b/install/poche.sqlite
index c268223d..7abf1f62 100755
--- a/install/poche.sqlite
+++ b/install/poche.sqlite
Binary files differ
diff --git a/install/update.php b/install/update.php
index 8c93af6d..ccc0566f 100644
--- a/install/update.php
+++ b/install/update.php
@@ -1,9 +1,9 @@
1<?php 1<?php
2require_once dirname(__FILE__).'/../inc/poche/Tools.class.php'; 2require_once dirname(__FILE__).'/../inc/poche/Tools.class.php';
3include dirname(__FILE__).'/../inc/poche/define.inc.php'; 3include dirname(__FILE__).'/../inc/poche/define.inc.php';
4include dirname(__FILE__).'/../inc/poche/myconfig.inc.php';
4require_once __DIR__ . '/../inc/poche/Database.class.php'; 5require_once __DIR__ . '/../inc/poche/Database.class.php';
5$store = new Database(); 6$store = new Database();
6$old_salt = '464v54gLLw928uz4zUBqkRJeiPY68zCX';
7?> 7?>
8<!DOCTYPE html> 8<!DOCTYPE html>
9<!--[if lte IE 6]> <html class="no-js ie6 ie67 ie678" lang="en"> <![endif]--> 9<!--[if lte IE 6]> <html class="no-js ie6 ie67 ie678" lang="en"> <![endif]-->
@@ -16,25 +16,23 @@ $old_salt = '464v54gLLw928uz4zUBqkRJeiPY68zCX';
16 <title>updating poche</title> 16 <title>updating poche</title>
17 </head> 17 </head>
18 <body> 18 <body>
19 <h1>update poche to 1.0-beta3</h1> 19 <h1>update poche to 1.0-beta4</h1>
20 20
21 <h2>Changelog</h2> 21 <h2>Changelog</h2>
22 <p> 22 <ul>
23 <ul> 23 <li>this awesome updating step</li>
24 <li>this awesome updating step</li> 24 <li>error message when install folder exists</li>
25 <li>error message when install folder exists</li> 25 <li>more tests before installation (write access, etc.)</li>
26 <li>more tests before installation (write access, etc.)</li> 26 <li>updated README to make installation easier</li>
27 <li>updated README to make installation easier</li> 27 <li>german language thanks to HLFH</li>
28 <li>german language thanks to HLFH</li> 28 <li>spanish language thanks to Nitche</li>
29 <li>spanish language thanks to Nitche</li> 29 <li>new file ./inc/poche/myconfig.inc.php created to store language and salt</li>
30 <li>new file ./inc/poche/myconfig.inc.php created to store language and salt</li> 30 <li><a href="https://github.com/inthepoche/poche/issues/119">#119</a>: salt is now created when installing poche</li>
31 <li><a href="https://github.com/inthepoche/poche/issues/119">#119</a>: salt is now created when installing poche</li> 31 <li><a href="https://github.com/inthepoche/poche/issues/130">#130</a>: robots.txt added</li>
32 <li><a href="https://github.com/inthepoche/poche/issues/130">#130</a>: robots.txt added</li> 32 <li><a href="https://github.com/inthepoche/poche/issues/136">#136</a>: error during readability import</li>
33 <li><a href="https://github.com/inthepoche/poche/issues/136">#136</a>: error during readability import</li> 33 <li><a href="https://github.com/inthepoche/poche/issues/137">#137</a>: mixed content alert in https</li>
34 <li><a href="https://github.com/inthepoche/poche/issues/137">#137</a>: mixed content alert in https</li> 34 <li><a href="https://github.com/inthepoche/poche/issues/138">#138</a>: change pattern to parse url with #</li>
35 <li><a href="https://github.com/inthepoche/poche/issues/138">#138</a>: change pattern to parse url with #</li> 35 </ul>
36 </ul>
37 </p>
38 <p>To update your poche, please fill the following fields.</p> 36 <p>To update your poche, please fill the following fields.</p>
39 <p> 37 <p>
40 <form name="update" method="post"> 38 <form name="update" method="post">
@@ -46,26 +44,20 @@ $old_salt = '464v54gLLw928uz4zUBqkRJeiPY68zCX';
46<?php 44<?php
47if (isset($_POST['go'])) { 45if (isset($_POST['go'])) {
48 if (!empty($_POST['login']) && !empty($_POST['password'])) { 46 if (!empty($_POST['login']) && !empty($_POST['password'])) {
49 $user = $store->login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . $old_salt)); 47 $user = $store->login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . SALT));
50 if ($user != array()) { 48 if ($user != array()) {
51 $new_salt = md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand());
52 $myconfig_file = '../inc/poche/myconfig.inc.php'; 49 $myconfig_file = '../inc/poche/myconfig.inc.php';
53 if (!is_writable('../inc/poche/')) { 50 # just change version number in config file
54 die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); 51
52 if (!is_writable('../inc/poche/myconfig.inc.php')) {
53 die('You don\'t have write access to open ./inc/poche/myconfig.inc.php.');
55 } 54 }
56 55
57 if (!file_exists($myconfig_file)) 56 if (file_exists($myconfig_file))
58 { 57 {
59 $fp = fopen($myconfig_file, 'w'); 58 $content = str_replace('1.0-beta3', '1.0-beta4', file_get_contents($myconfig_file));
60 59 file_put_contents($myconfig_file, $content);
61 fwrite($fp, '<?php'."\r\n");
62 fwrite($fp, "define ('POCHE_VERSION', '1.0-beta3');" . "\r\n");
63 fwrite($fp, "define ('SALT', '" . $new_salt . "');" . "\r\n");
64 fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n");
65 fclose($fp);
66 } 60 }
67 # faire une mise à jour de la table users en prenant en compte le nouveau SALT généré
68 $store->updatePassword($user['id'], sha1($_POST['password'] . $_POST['login'] . $new_salt));
69?> 61?>
70 <p><span style="color: green;">your poche is up to date!</span></p> 62 <p><span style="color: green;">your poche is up to date!</span></p>
71 <p><span style="color: red;">don't forget to delete ./install/ folder after the update.</span></p> 63 <p><span style="color: red;">don't forget to delete ./install/ folder after the update.</span></p>
diff --git a/install/update_to_1beta3.php b/install/update_to_1beta3.php
new file mode 100644
index 00000000..8c93af6d
--- /dev/null
+++ b/install/update_to_1beta3.php
@@ -0,0 +1,79 @@
1<?php
2require_once dirname(__FILE__).'/../inc/poche/Tools.class.php';
3include dirname(__FILE__).'/../inc/poche/define.inc.php';
4require_once __DIR__ . '/../inc/poche/Database.class.php';
5$store = new Database();
6$old_salt = '464v54gLLw928uz4zUBqkRJeiPY68zCX';
7?>
8<!DOCTYPE html>
9<!--[if lte IE 6]> <html class="no-js ie6 ie67 ie678" lang="en"> <![endif]-->
10<!--[if lte IE 7]> <html class="no-js ie7 ie67 ie678" lang="en"> <![endif]-->
11<!--[if IE 8]> <html class="no-js ie8 ie678" lang="en"> <![endif]-->
12<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
13<html>
14 <head>
15 <meta charset="utf-8">
16 <title>updating poche</title>
17 </head>
18 <body>
19 <h1>update poche to 1.0-beta3</h1>
20
21 <h2>Changelog</h2>
22 <p>
23 <ul>
24 <li>this awesome updating step</li>
25 <li>error message when install folder exists</li>
26 <li>more tests before installation (write access, etc.)</li>
27 <li>updated README to make installation easier</li>
28 <li>german language thanks to HLFH</li>
29 <li>spanish language thanks to Nitche</li>
30 <li>new file ./inc/poche/myconfig.inc.php created to store language and salt</li>
31 <li><a href="https://github.com/inthepoche/poche/issues/119">#119</a>: salt is now created when installing poche</li>
32 <li><a href="https://github.com/inthepoche/poche/issues/130">#130</a>: robots.txt added</li>
33 <li><a href="https://github.com/inthepoche/poche/issues/136">#136</a>: error during readability import</li>
34 <li><a href="https://github.com/inthepoche/poche/issues/137">#137</a>: mixed content alert in https</li>
35 <li><a href="https://github.com/inthepoche/poche/issues/138">#138</a>: change pattern to parse url with #</li>
36 </ul>
37 </p>
38 <p>To update your poche, please fill the following fields.</p>
39 <p>
40 <form name="update" method="post">
41 <div><label for="login">login:</label> <input type="text" name="login" id="login" /></div>
42 <div><label for="password">password:</label> <input type="password" name="password" id="password" /></div>
43 <div><input type="hidden" name="go" value="ok" /><input type="submit" value="update" /></div>
44 </form>
45 </p>
46<?php
47if (isset($_POST['go'])) {
48 if (!empty($_POST['login']) && !empty($_POST['password'])) {
49 $user = $store->login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . $old_salt));
50 if ($user != array()) {
51 $new_salt = md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand());
52 $myconfig_file = '../inc/poche/myconfig.inc.php';
53 if (!is_writable('../inc/poche/')) {
54 die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.');
55 }
56
57 if (!file_exists($myconfig_file))
58 {
59 $fp = fopen($myconfig_file, 'w');
60
61 fwrite($fp, '<?php'."\r\n");
62 fwrite($fp, "define ('POCHE_VERSION', '1.0-beta3');" . "\r\n");
63 fwrite($fp, "define ('SALT', '" . $new_salt . "');" . "\r\n");
64 fwrite($fp, "define ('LANG', 'en_EN.utf8');" . "\r\n");
65 fclose($fp);
66 }
67 # faire une mise à jour de la table users en prenant en compte le nouveau SALT généré
68 $store->updatePassword($user['id'], sha1($_POST['password'] . $_POST['login'] . $new_salt));
69?>
70 <p><span style="color: green;">your poche is up to date!</span></p>
71 <p><span style="color: red;">don't forget to delete ./install/ folder after the update.</span></p>
72 <p><a href="../">go back to your poche</a></p>
73<?php
74 }
75 }
76}
77?>
78 </body>
79</html> \ No newline at end of file
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
deleted file mode 100644
index e69de29b..00000000
--- a/phpunit.xml.dist
+++ /dev/null
diff --git a/tpl/config.twig b/tpl/config.twig
index 0b231187..e8563721 100644
--- a/tpl/config.twig
+++ b/tpl/config.twig
@@ -13,12 +13,12 @@
13{% block content %} 13{% block content %}
14 <h2>{% trans "Poching a link" %}</h2> 14 <h2>{% trans "Poching a link" %}</h2>
15 <p>You can poche a link by several methods: (<a href="http://www.inthepoche.com/?pages/Documentation" title="{% trans "read the documentation" %}">?</a>)</p> 15 <p>You can poche a link by several methods: (<a href="http://www.inthepoche.com/?pages/Documentation" title="{% trans "read the documentation" %}">?</a>)</p>
16 <ul> 16 <ul>
17 <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li> 17 <li>firefox: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.xpi" title="download the firefox extension">download the extension</a></li>
18 <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li> 18 <li>chrome: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/poche.crx" title="download the chrome extension">download the extension</a></li>
19 <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li> 19 <li>android: <a href="https://bitbucket.org/jogaulupeau/poche/downloads/Poche.apk" title="download the application">download the application</a></li>
20 <li>bookmarklet: drag & drop this link to your bookmarks bar <a ondragend="this.click();" style="cursor: move; border: 1px dashed grey; background: white; padding: 5px;" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@inthepoche.com']){top['bookmarklet-url@inthepoche.com'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></li> 20 <li>bookmarklet: drag & drop this link to your bookmarks bar <a ondragend="this.click();" style="cursor: move; border: 1px dashed grey; background: white; padding: 5px;" title="i am a bookmarklet, use me !" href="javascript:if(top['bookmarklet-url@inthepoche.com']){top['bookmarklet-url@inthepoche.com'];}else{(function(){var%20url%20=%20location.href%20||%20url;window.open('{{ poche_url }}?action=add&url='%20+%20btoa(url),'_self');})();void(0);}">{% trans "poche it!" %}</a></li>
21 </ul> 21 </ul>
22 22
23 <h2>{% trans "Updating poche" %}</h2> 23 <h2>{% trans "Updating poche" %}</h2>
24 <ul> 24 <ul>
@@ -50,9 +50,9 @@
50 <p>{% trans "Please execute the import script locally, it can take a very long time." %}</p> 50 <p>{% trans "Please execute the import script locally, it can take a very long time." %}</p>
51 <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a></p> 51 <p>{% trans "More infos in the official doc:" %} <a href="http://inthepoche.com/?pages/Documentation">inthepoche.com</a></p>
52 <ul> 52 <ul>
53 <li><a href="./?import&amp;from=pocket">{% trans "import from Pocket" %}</a> (you must have a "ril_export.html" file on your server)</li> 53 <li><a href="./?import&amp;from=pocket">{% trans "import from Pocket" %}</a> (you must have a "ril_export.html" file on your server)</li>
54 <li><a href="./?import&amp;from=readability">{% trans "import from Readability" %}</a> (you must have a "readability" file on your server)</li> 54 <li><a href="./?import&amp;from=readability">{% trans "import from Readability" %}</a> (you must have a "readability" file on your server)</li>
55 <li><a href="./?import&amp;from=instapaper">{% trans "import from Instapaper" %}</a> (you must have a "instapaper-export.html" file on your server)</li> 55 <li><a href="./?import&amp;from=instapaper">{% trans "import from Instapaper" %}</a> (you must have a "instapaper-export.html" file on your server)</li>
56 </ul> 56 </ul>
57 57
58 <h2>{% trans "Export your poche datas" %}</h2> 58 <h2>{% trans "Export your poche datas" %}</h2>
diff --git a/tpl/error.twig b/tpl/error.twig
index 84c3bc1c..14c49925 100644
--- a/tpl/error.twig
+++ b/tpl/error.twig
@@ -1,7 +1,6 @@
1{% extends "layout.twig" %} 1{% extends "layout.twig" %}
2{% block title %}{% trans "error" %}{% endblock %} 2{% block title %}{% trans "plop" %}{% endblock %}
3{% block content %} 3{% block content %}
4 <h1>error</h1> 4 {{ msg|raw }}
5 <p>{{ msg|raw }}</p>
6 <p>Don't forget <a href="http://inthepoche.com/?pages/Documentation">the documentation</a>.</p> 5 <p>Don't forget <a href="http://inthepoche.com/?pages/Documentation">the documentation</a>.</p>
7{% endblock %} \ No newline at end of file 6{% endblock %} \ No newline at end of file
diff --git a/tpl/layout.twig b/tpl/layout.twig
index 7084a215..07ca231c 100644
--- a/tpl/layout.twig
+++ b/tpl/layout.twig
@@ -7,7 +7,9 @@
7 <head> 7 <head>
8 <meta name="viewport" content="initial-scale=1.0"> 8 <meta name="viewport" content="initial-scale=1.0">
9 <meta charset="utf-8"> 9 <meta charset="utf-8">
10 <!--[if IE]>
10 <meta http-equiv="X-UA-Compatible" content="IE=10"> 11 <meta http-equiv="X-UA-Compatible" content="IE=10">
12 <![endif]-->
11 <title>{% block title %}{% endblock %} - poche</title> 13 <title>{% block title %}{% endblock %} - poche</title>
12{% include '_head.twig' %} 14{% include '_head.twig' %}
13{% include '_bookmarklet.twig' %} 15{% include '_bookmarklet.twig' %}