diff options
author | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-16 20:19:31 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas.loeuillet@gmail.com> | 2013-08-16 20:19:31 +0200 |
commit | bb5a7d9ede48558c6f096dc3c8e267f12513ec4e (patch) | |
tree | fb85a197e1916c9a4e880edfabd0f99e25b23750 /inc/poche/Poche.class.php | |
parent | 1c9cd3463b820b874610f4fd13e0193dc9e6429c (diff) | |
download | wallabag-bb5a7d9ede48558c6f096dc3c8e267f12513ec4e.tar.gz wallabag-bb5a7d9ede48558c6f096dc3c8e267f12513ec4e.tar.zst wallabag-bb5a7d9ede48558c6f096dc3c8e267f12513ec4e.zip |
updating script
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r-- | inc/poche/Poche.class.php | 30 |
1 files changed, 20 insertions, 10 deletions
diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 4371c3d3..cb865a2a 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php | |||
@@ -41,15 +41,23 @@ class Poche | |||
41 | { | 41 | { |
42 | $msg = ''; | 42 | $msg = ''; |
43 | $allIsGood = TRUE; | 43 | $allIsGood = TRUE; |
44 | if (file_exists('./install') && !DEBUG_POCHE) { | 44 | |
45 | Tools::logm('folder /install exists'); | 45 | if (file_exists('./install/update.php') && !DEBUG_POCHE) { |
46 | $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.'; | ||
47 | $allIsGood = FALSE; | ||
48 | } | ||
49 | else if (file_exists('./install') && !DEBUG_POCHE) { | ||
46 | $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.'; | 50 | $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.'; |
47 | $allIsGood = FALSE; | 51 | $allIsGood = FALSE; |
48 | } | 52 | } |
49 | 53 | else if (STORAGE == 'sqlite' && !is_writable(STORAGE_SQLITE)) { | |
50 | if (STORAGE == 'sqlite' && !is_writable(STORAGE_SQLITE)) { | 54 | Tools::logm('you don\'t have write access on sqlite file'); |
51 | Tools::logm('you don\'t have write access on db file'); | 55 | $msg = 'You don\'t have write access on sqlite file.'; |
52 | $msg = 'You don\'t have write access on ' . STORAGE_SQLITE . ' file.'; | 56 | $allIsGood = FALSE; |
57 | } | ||
58 | else if (!is_writable(CACHE)) { | ||
59 | Tools::logm('you don\'t have write access on cache directory'); | ||
60 | $msg = 'You don\'t have write access on cache directory.'; | ||
53 | $allIsGood = FALSE; | 61 | $allIsGood = FALSE; |
54 | } | 62 | } |
55 | 63 | ||
@@ -118,10 +126,12 @@ class Poche | |||
118 | if (($_POST['password'] == $_POST['password_repeat']) | 126 | if (($_POST['password'] == $_POST['password_repeat']) |
119 | && $_POST['password'] != "" && $_POST['login'] != "") { | 127 | && $_POST['password'] != "" && $_POST['login'] != "") { |
120 | # let's rock, install poche baby ! | 128 | # let's rock, install poche baby ! |
121 | $this->store->install($_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login'])); | 129 | if ($this->store->install($_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login']))) |
122 | Session::logout(); | 130 | { |
123 | Tools::logm('poche is now installed'); | 131 | Session::logout(); |
124 | Tools::redirect(); | 132 | Tools::logm('poche is now installed'); |
133 | Tools::redirect(); | ||
134 | } | ||
125 | } | 135 | } |
126 | else { | 136 | else { |
127 | Tools::logm('error during installation'); | 137 | Tools::logm('error during installation'); |