aboutsummaryrefslogtreecommitdiffhomepage
path: root/install/update.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-25 12:12:53 -0700
committerNicolas Lœuillet <nicolas.loeuillet@gmail.com>2013-08-25 12:12:53 -0700
commitc51be6b697da573cdcf0788eb8617130ce5517a4 (patch)
tree642eaf70afb134dee5f274c84bf15b8aab00c117 /install/update.php
parent7ba37bd91a43321196e6d867caf9e298e82c6d6c (diff)
parent063fc1a7baaf6f7e1fb08eced058962a6140a471 (diff)
downloadwallabag-c51be6b697da573cdcf0788eb8617130ce5517a4.tar.gz
wallabag-c51be6b697da573cdcf0788eb8617130ce5517a4.tar.zst
wallabag-c51be6b697da573cdcf0788eb8617130ce5517a4.zip
Merge pull request #181 from inthepoche/dev
beta4
Diffstat (limited to 'install/update.php')
-rw-r--r--install/update.php62
1 files changed, 30 insertions, 32 deletions
diff --git a/install/update.php b/install/update.php
index 8c93af6d..1deaf7f3 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,29 @@ $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>enhancement: updating and installing poche are more easier</li>
24 <li>this awesome updating step</li> 24 <li>enhancement: poche now uses Full Text RSS to fetch content</li>
25 <li>error message when install folder exists</li> 25 <li>enhancement: css and twig files are more clean, thanks to NumEricR and nicofrand</li>
26 <li>more tests before installation (write access, etc.)</li> 26 <li>enhancement: updated german translation, thanks to HLFH</li>
27 <li>updated README to make installation easier</li> 27 <li>enhancement: add db/, cache/ and assets/ directories in versioning</li>
28 <li>german language thanks to HLFH</li> 28 <li>enhancement: display messages when error with import, thanks to EliasZ</li>
29 <li>spanish language thanks to Nitche</li> 29 <li>enhancement: poche compatibility test file</li>
30 <li>new file ./inc/poche/myconfig.inc.php created to store language and salt</li> 30 <li>enhancement: <a href="https://github.com/inthepoche/poche/issues/112">#112</a>: link with shaarli</li>
31 <li><a href="https://github.com/inthepoche/poche/issues/119">#119</a>: salt is now created when installing poche</li> 31 <li>enhancement: <a href="https://github.com/inthepoche/poche/issues/162">#162</a>: links to firefox / chrome / android apps in config screen</li>
32 <li><a href="https://github.com/inthepoche/poche/issues/130">#130</a>: robots.txt added</li> 32 <li>bug: encode url to share with twitter / email / shaarli</li>
33 <li><a href="https://github.com/inthepoche/poche/issues/136">#136</a>: error during readability import</li> 33 <li>bug: Add IPv4 url support (and others beginning by a digit)</li>
34 <li><a href="https://github.com/inthepoche/poche/issues/137">#137</a>: mixed content alert in https</li> 34 <li>bug: title page in article view was wrong</li>
35 <li><a href="https://github.com/inthepoche/poche/issues/138">#138</a>: change pattern to parse url with #</li> 35 <li>bug: <a href="https://github.com/inthepoche/poche/issues/148">#148</a>: use of undefined constant POCHE_VERSION</li>
36 </ul> 36 <li>bug: <a href="https://github.com/inthepoche/poche/issues/148">#149</a>: can't poche theguardian.com</li>
37 </p> 37 <li>bug: <a href="https://github.com/inthepoche/poche/issues/150">#150</a>: default title for untitled articles</li>
38 <li>bug: <a href="https://github.com/inthepoche/poche/issues/150">#151</a>: HTML entities in titles are encoded twice</li>
39 <li>bug: <a href="https://github.com/inthepoche/poche/issues/169">#169</a>: entries height with short description</li>
40 <li>bug: <a href="https://github.com/inthepoche/poche/issues/175">#175</a>: IP addresses do not appear in "view original"</li>
41 </ul>
38 <p>To update your poche, please fill the following fields.</p> 42 <p>To update your poche, please fill the following fields.</p>
39 <p> 43 <p>
40 <form name="update" method="post"> 44 <form name="update" method="post">
@@ -46,26 +50,20 @@ $old_salt = '464v54gLLw928uz4zUBqkRJeiPY68zCX';
46<?php 50<?php
47if (isset($_POST['go'])) { 51if (isset($_POST['go'])) {
48 if (!empty($_POST['login']) && !empty($_POST['password'])) { 52 if (!empty($_POST['login']) && !empty($_POST['password'])) {
49 $user = $store->login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . $old_salt)); 53 $user = $store->login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . SALT));
50 if ($user != array()) { 54 if ($user != array()) {
51 $new_salt = md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand());
52 $myconfig_file = '../inc/poche/myconfig.inc.php'; 55 $myconfig_file = '../inc/poche/myconfig.inc.php';
53 if (!is_writable('../inc/poche/')) { 56 # just change version number in config file
54 die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); 57
58 if (!is_writable('../inc/poche/myconfig.inc.php')) {
59 die('You don\'t have write access to open ./inc/poche/myconfig.inc.php.');
55 } 60 }
56 61
57 if (!file_exists($myconfig_file)) 62 if (file_exists($myconfig_file))
58 { 63 {
59 $fp = fopen($myconfig_file, 'w'); 64 $content = str_replace('1.0-beta3', '1.0-beta4', file_get_contents($myconfig_file));
60 65 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 } 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?> 67?>
70 <p><span style="color: green;">your poche is up to date!</span></p> 68 <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> 69 <p><span style="color: red;">don't forget to delete ./install/ folder after the update.</span></p>