diff options
Diffstat (limited to 'install')
-rwxr-xr-x | install/poche.sqlite | bin | 360448 -> 360448 bytes | |||
-rw-r--r-- | install/update.php | 56 | ||||
-rw-r--r-- | install/update_to_1beta3.php | 79 |
3 files changed, 103 insertions, 32 deletions
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 |
2 | require_once dirname(__FILE__).'/../inc/poche/Tools.class.php'; | 2 | require_once dirname(__FILE__).'/../inc/poche/Tools.class.php'; |
3 | include dirname(__FILE__).'/../inc/poche/define.inc.php'; | 3 | include dirname(__FILE__).'/../inc/poche/define.inc.php'; |
4 | include dirname(__FILE__).'/../inc/poche/myconfig.inc.php'; | ||
4 | require_once __DIR__ . '/../inc/poche/Database.class.php'; | 5 | require_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 |
47 | if (isset($_POST['go'])) { | 45 | if (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 | ||
2 | require_once dirname(__FILE__).'/../inc/poche/Tools.class.php'; | ||
3 | include dirname(__FILE__).'/../inc/poche/define.inc.php'; | ||
4 | require_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 | ||
47 | if (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 | ||