aboutsummaryrefslogtreecommitdiffhomepage
path: root/inc/poche/Poche.class.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/poche/Poche.class.php')
-rw-r--r--inc/poche/Poche.class.php30
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');