diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index e0dc0d201..cc2d8de35 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -35,7 +35,7 @@ class Poche /** * all checks before installation. - * @return boolean + * @return boolean */ private function checkBeforeInstall() { @@ -47,7 +47,7 @@ class Poche die('You don\'t have write access on cache directory.'); } else if (file_exists('./install/update.php') && !DEBUG_POCHE) { - $msg = 'A poche update is needed. Please execute this update by clicking here. If you have already do the update, please delete /install folder.'; + $msg = 'A poche update is needed. Please execute this update by clicking here. If you have already done the update, please delete /install folder.'; $allIsGood = FALSE; } else if (file_exists('./install') && !DEBUG_POCHE) { @@ -59,7 +59,7 @@ class Poche $msg = 'You don\'t have write access on sqlite file.'; $allIsGood = FALSE; } - + if (!$allIsGood) { echo $this->tpl->render('error.twig', array( 'msg' => $msg @@ -90,7 +90,7 @@ class Poche $this->tpl->addFilter($filter); } - private function init() + private function init() { Tools::initPhp(); Session::init(); @@ -108,21 +108,21 @@ class Poche $language = $this->user->getConfigValue('language'); putenv('LC_ALL=' . $language); setlocale(LC_ALL, $language); - bindtextdomain($language, LOCALE); - textdomain($language); + bindtextdomain($language, LOCALE); + textdomain($language); # Pagination $this->pagination = new Paginator($this->user->getConfigValue('pager'), 'p'); } - private function install() + private function install() { Tools::logm('poche still not installed'); echo $this->tpl->render('install.twig', array( 'token' => Session::getToken() )); if (isset($_GET['install'])) { - if (($_POST['password'] == $_POST['password_repeat']) + if (($_POST['password'] == $_POST['password_repeat']) && $_POST['password'] != "" && $_POST['login'] != "") { # let's rock, install poche baby ! if ($this->store->install($_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login']))) @@ -280,8 +280,8 @@ class Poche } /** - * update the password of the current user. - * if MODE_DEMO is TRUE, the password can't be updated. + * update the password of the current user. + * if MODE_DEMO is TRUE, the password can't be updated. * @todo add the return value * @todo set the new password in function header like this updatePassword($newPassword) * @return boolean @@ -350,7 +350,7 @@ class Poche /** * log out the poche user. It cleans the session. * @todo add the return value - * @return boolean + * @return boolean */ public function logout() { @@ -403,7 +403,7 @@ class Poche /** * import from Pocket. poche needs a ./ril_export.html file * @todo add the return value - * @return boolean + * @return boolean */ private function importFromPocket() { @@ -430,7 +430,7 @@ class Poche $this->action('toggle_archive', $url, $last_id, TRUE); } } - + # the second
-
To update your poche, please fill the following fields.
--
your poche is up to date!
-don't forget to delete ./install/ folder after the update.
- - - - \ No newline at end of file diff --git a/install/update_sqlite_from_0_to_1.php b/install/update_sqlite_from_0_to_1.php deleted file mode 100644 index 299abf48d..000000000 --- a/install/update_sqlite_from_0_to_1.php +++ /dev/null @@ -1,72 +0,0 @@ -setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); - -# Requêtes à exécuter pour mettre à jour poche.sqlite en 1.x - -# ajout d'un champ user_id sur la table entries -$sql = 'ALTER TABLE entries RENAME TO tempEntries;'; -$query = $handle->prepare($sql); -$query->execute(); - -$sql = 'CREATE TABLE entries (id INTEGER PRIMARY KEY, title TEXT, url TEXT, is_read NUMERIC DEFAULT 0, is_fav NUMERIC DEFAULT 0, content BLOB, user_id NUMERIC);'; -$query = $handle->prepare($sql); -$query->execute(); - -$sql = 'INSERT INTO entries (id, title, url, is_read, is_fav, content) SELECT id, title, url, is_read, is_fav, content FROM tempEntries;'; -$query = $handle->prepare($sql); -$query->execute(); - -# Update tout pour mettre user_id = 1 -$sql = 'UPDATE entries SET user_id = 1;'; -$query = $handle->prepare($sql); -$query->execute(); - -# Changement des flags pour les lus / favoris -$sql = 'UPDATE entries SET is_read = 1 WHERE is_read = -1;'; -$query = $handle->prepare($sql); -$query->execute(); - -$sql = 'UPDATE entries SET is_fav = 1 WHERE is_fav = -1;'; -$query = $handle->prepare($sql); -$query->execute(); - -# Création de la table users -$sql = 'CREATE TABLE users (id INTEGER PRIMARY KEY, username TEXT, password TEXT, name TEXT, email TEXT);'; -$query = $handle->prepare($sql); -$query->execute(); - -$sql = 'INSERT INTO users (username) SELECT value FROM config WHERE name = "login";'; -$query = $handle->prepare($sql); -$query->execute(); - -$sql = "UPDATE users SET password = (SELECT value FROM config WHERE name = 'password')"; -$query = $handle->prepare($sql); -$query->execute(); - -# Création de la table users_config -$sql = 'CREATE TABLE users_config (id INTEGER PRIMARY KEY, user_id NUMERIC, name TEXT, value TEXT);'; -$query = $handle->prepare($sql); -$query->execute(); - -$sql = 'INSERT INTO users_config (user_id, name, value) VALUES (1, "pager", "10");'; -$query = $handle->prepare($sql); -$query->execute(); - -$sql = 'INSERT INTO users_config (user_id, name, value) VALUES (1, "language", "en_EN.UTF8");'; -$query = $handle->prepare($sql); -$query->execute(); - -# Suppression de la table temporaire -$sql = 'DROP TABLE tempEntries;'; -$query = $handle->prepare($sql); -$query->execute(); - -# Vidage de la table de config -$sql = 'DELETE FROM config;'; -$query = $handle->prepare($sql); -$query->execute(); - -echo 'welcome to poche 1.0 !'; \ No newline at end of file diff --git a/tpl/config.twig b/tpl/config.twig index 5324cda74..9f2fe5a4e 100644 --- a/tpl/config.twig +++ b/tpl/config.twig @@ -14,15 +14,14 @@{% trans "Thanks to the bookmarklet, you will be able to easily add a link to your poche." %} {% trans "Have a look to this documentation:" %} inthepoche.com.
{% trans "Drag & drop this link to your bookmarks bar and have fun with poche." %}
- +