From 06fef4318047ed8594ba0533ab228ee5838cd86f Mon Sep 17 00:00:00 2001 From: NumEricR Date: Sat, 5 Oct 2013 10:51:25 +0200 Subject: Fix #255 : increase article toolbar height if necessary --- themes/default/css/style.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/css/style.css b/themes/default/css/style.css index eb04f0c4..3ef9c823 100644 --- a/themes/default/css/style.css +++ b/themes/default/css/style.css @@ -188,7 +188,7 @@ a:visited { bottom: 0; left: 0; width: 100%; - height: 50px; + min-height: 50px; padding-top: 17px; text-align: center; color: #fff; -- cgit v1.2.3 From 89812ec81cf77af32942d151372a8667c716fe30 Mon Sep 17 00:00:00 2001 From: NumEricR Date: Sat, 5 Oct 2013 10:52:08 +0200 Subject: Remove useless filter on .git folder --- inc/poche/Poche.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 1ba8e7c1..1a655386 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -258,7 +258,7 @@ class Poche while (($theme = readdir($handle)) !== false) { # Themes are stored in a directory, so all directory names are themes # @todo move theme installation data to database - if (! is_dir(THEME . '/' . $theme) || in_array($theme, array('..', '.', '.git'))) { + if (! is_dir(THEME . '/' . $theme) || in_array($theme, array('..', '.'))) { continue; } -- cgit v1.2.3 From 2287bf06f533e1dc03979d3945af098601963712 Mon Sep 17 00:00:00 2001 From: NumEricR Date: Sat, 5 Oct 2013 11:03:41 +0200 Subject: Sort themes alphabetically in config list --- inc/poche/Poche.class.php | 1 + 1 file changed, 1 insertion(+) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 1a655386..6325adcf 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -271,6 +271,7 @@ class Poche $themes[] = array('name' => $theme, 'current' => $current); } + sort($themes); return $themes; } -- cgit v1.2.3 From 125f9ee83842cd6ad6cfcbcbfcaa951ec0396733 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Saad-Dupuy Date: Mon, 7 Oct 2013 12:30:40 +0200 Subject: Added support for custom ssl port --- inc/poche/Tools.class.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 8eb988f4..6f2bc6e7 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -41,10 +41,14 @@ class Tools $https = (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) == 'on')) || (isset($_SERVER["SERVER_PORT"]) - && $_SERVER["SERVER_PORT"] == '443'); // HTTPS detection. + && $_SERVER["SERVER_PORT"] == '443') // HTTPS detection. + || (isset($_SERVER["SERVER_PORT"]) && isset($SSL_PORT) //Custom HTTPS port detection + && $_SERVER["SERVER_PORT"] == $SSL_PORT); + $serverport = (!isset($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == '80' || ($https && $_SERVER["SERVER_PORT"] == '443') + || ($https && $_SERVER["SERVER_PORT"]==$SSL_PORT) //Custom HTTPS port detection ? '' : ':' . $_SERVER["SERVER_PORT"]); $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); @@ -243,4 +247,4 @@ class Tools $lang = explode('.', $userlanguage); return str_replace('_', '-', $lang[0]); } -} \ No newline at end of file +} -- cgit v1.2.3 From 93eed125058574ef407e2edede6740629f7f0a43 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Saad-Dupuy Date: Mon, 7 Oct 2013 12:31:46 +0200 Subject: Fixed typo --- themes/default/_head.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/_head.twig b/themes/default/_head.twig index dfebd91d..9745459c 100644 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig @@ -8,4 +8,4 @@ - + -- cgit v1.2.3 From 2621569200cfc85f2dd6fb77481c9531942c0642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 12:39:11 +0200 Subject: missing } --- themes/default/_head.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/_head.twig b/themes/default/_head.twig index dfebd91d..9745459c 100644 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig @@ -8,4 +8,4 @@ - + -- cgit v1.2.3 From 2916d24b209e1e36cf22cb902d7e6dc34113c7e5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Saad-Dupuy Date: Mon, 7 Oct 2013 12:47:13 +0200 Subject: Added support for custom SSL port --- inc/poche/Tools.class.php | 6 +++--- inc/poche/config.inc.php.new | 5 ++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 6f2bc6e7..1d092823 100644 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php @@ -42,13 +42,13 @@ class Tools && (strtolower($_SERVER['HTTPS']) == 'on')) || (isset($_SERVER["SERVER_PORT"]) && $_SERVER["SERVER_PORT"] == '443') // HTTPS detection. - || (isset($_SERVER["SERVER_PORT"]) && isset($SSL_PORT) //Custom HTTPS port detection - && $_SERVER["SERVER_PORT"] == $SSL_PORT); + || (isset($_SERVER["SERVER_PORT"]) //Custom HTTPS port detection + && $_SERVER["SERVER_PORT"] == SSL_PORT); $serverport = (!isset($_SERVER["SERVER_PORT"]) || $_SERVER["SERVER_PORT"] == '80' || ($https && $_SERVER["SERVER_PORT"] == '443') - || ($https && $_SERVER["SERVER_PORT"]==$SSL_PORT) //Custom HTTPS port detection + || ($https && $_SERVER["SERVER_PORT"]==SSL_PORT) //Custom HTTPS port detection ? '' : ':' . $_SERVER["SERVER_PORT"]); $scriptname = str_replace('/index.php', '/', $_SERVER["SCRIPT_NAME"]); diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new index 255b97e6..902509e3 100755 --- a/inc/poche/config.inc.php.new +++ b/inc/poche/config.inc.php.new @@ -25,6 +25,9 @@ define ('STORAGE_PASSWORD', 'poche'); # Do not trespass unless you know what you are doing ################################################################################# +// Change this if not using the standart port for SSL - i.e you server is behind sslh +define ('SSL_PORT', 443); + define ('MODE_DEMO', FALSE); define ('DEBUG_POCHE', FALSE); define ('DOWNLOAD_PICTURES', FALSE); @@ -57,4 +60,4 @@ define ('INSTAPAPER_FILE', '/instapaper-export.html'); define ('IMPORT_POCKET_FILE', ROOT . POCKET_FILE); define ('IMPORT_READABILITY_FILE', ROOT . READABILITY_FILE); -define ('IMPORT_INSTAPAPER_FILE', ROOT . INSTAPAPER_FILE); \ No newline at end of file +define ('IMPORT_INSTAPAPER_FILE', ROOT . INSTAPAPER_FILE); -- cgit v1.2.3 From 5eebe4e50dd5da7e87e98c366205ed3266348603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 13:06:10 +0200 Subject: delete href --- themes/default/_head.twig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/themes/default/_head.twig b/themes/default/_head.twig index 9745459c..247b929e 100644 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig @@ -8,4 +8,4 @@ - + -- cgit v1.2.3 From 9d3b88b3796496b68e762d50904a7ab609edc9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 13:12:28 +0200 Subject: bug fix #266: make installation steps easier --- inc/poche/Poche.class.php | 85 ++++++++++++++++++++++++----------------------- index.php | 7 +++- themes/default/error.twig | 9 +++-- 3 files changed, 57 insertions(+), 44 deletions(-) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 1ba8e7c1..899d7356 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -20,7 +20,7 @@ class Poche public $pagination; private $currentTheme = ''; - private $notInstalledMessage = ''; + private $notInstalledMessage = array(); # @todo make this dynamic (actually install themes and save them in the database including author information et cetera) private $installedThemes = array( @@ -33,28 +33,21 @@ class Poche public function __construct() { - if (! $this->configFileIsAvailable()) { - return; + if ($this->configFileIsAvailable()) { + $this->init(); } - $this->init(); - - if (! $this->themeIsInstalled()) { - return; + if ($this->themeIsInstalled()) { + $this->initTpl(); } - $this->initTpl(); - - if (! $this->systemIsInstalled()) { - return; - } - - $this->store = new Database(); - $this->messages = new Messages(); - - # installation - if (! $this->store->isInstalled()) { - $this->install(); + if ($this->systemIsInstalled()) { + $this->store = new Database(); + $this->messages = new Messages(); + # installation + if (! $this->store->isInstalled()) { + $this->install(); + } } } @@ -94,7 +87,7 @@ class Poche public function configFileIsAvailable() { if (! self::$configFileAvailable) { - $this->notInstalledMessage = 'You have to rename inc/poche/config.inc.php.new to inc/poche/config.inc.php.'; + $this->notInstalledMessage[] = 'You have to rename inc/poche/config.inc.php.new to inc/poche/config.inc.php.'; return false; } @@ -103,39 +96,44 @@ class Poche } public function themeIsInstalled() { + $passTheme = TRUE; # Twig is an absolute requirement for Poche to function. Abort immediately if the Composer installer hasn't been run yet if (! self::$canRenderTemplates) { - $this->notInstalledMessage = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; - - return false; + $this->notInstalledMessage[] = 'Twig does not seem to be installed. Please initialize the Composer installation to automatically fetch dependencies. Have a look at the documentation.'; + $passTheme = FALSE; } if (! is_writable(CACHE)) { - $this->notInstalledMessage = '

error

You don\'t have write access on cache directory.

'; + $this->notInstalledMessage[] = 'You don\'t have write access on cache directory.'; self::$canRenderTemplates = false; - return false; + $passTheme = FALSE; } # Check if the selected theme and its requirements are present - if (! is_dir(THEME . '/' . $this->getTheme())) { - $this->notInstalledMessage = 'The currently selected theme (' . $this->getTheme() . ') does not seem to be properly installed (Missing directory: ' . THEME . '/' . $this->getTheme() . ')'; + if ($this->getTheme() != '' && ! is_dir(THEME . '/' . $this->getTheme())) { + $this->notInstalledMessage[] = 'The currently selected theme (' . $this->getTheme() . ') does not seem to be properly installed (Missing directory: ' . THEME . '/' . $this->getTheme() . ')'; self::$canRenderTemplates = false; - return false; + $passTheme = FALSE; } foreach ($this->installedThemes[$this->getTheme()]['requires'] as $requiredTheme) { if (! is_dir(THEME . '/' . $requiredTheme)) { - $this->notInstalledMessage = 'The required "' . $requiredTheme . '" theme is missing for the current theme (' . $this->getTheme() . ')'; + $this->notInstalledMessage[] = 'The required "' . $requiredTheme . '" theme is missing for the current theme (' . $this->getTheme() . ')'; self::$canRenderTemplates = false; - return false; + $passTheme = FALSE; } } + + if (!$passTheme) { + return FALSE; + } + return true; } @@ -147,25 +145,30 @@ class Poche */ public function systemIsInstalled() { - $msg = ''; + $msg = TRUE; $configSalt = defined('SALT') ? constant('SALT') : ''; if (empty($configSalt)) { - $msg = '

error

You have not yet filled in the SALT value in the config.inc.php file.

'; - } else if (STORAGE == 'sqlite' && ! file_exists(STORAGE_SQLITE)) { + $this->notInstalledMessage[] = 'You have not yet filled in the SALT value in the config.inc.php file.'; + $msg = FALSE; + } + if (STORAGE == 'sqlite' && ! file_exists(STORAGE_SQLITE)) { Tools::logm('sqlite file doesn\'t exist'); - $msg = '

error

sqlite file doesn\'t exist, you can find it in install folder. Copy it in /db folder.

'; - } else if (is_dir(ROOT . '/install') && ! DEBUG_POCHE) { - $msg = '

install folder

you have to delete the /install folder before using poche.

'; - } else if (STORAGE == 'sqlite' && ! is_writable(STORAGE_SQLITE)) { + $this->notInstalledMessage[] = 'sqlite file doesn\'t exist, you can find it in install folder. Copy it in /db folder.'; + $msg = FALSE; + } + if (is_dir(ROOT . '/install') && ! DEBUG_POCHE) { + $this->notInstalledMessage[] = 'you have to delete the /install folder before using poche.'; + $msg = FALSE; + } + if (STORAGE == 'sqlite' && ! is_writable(STORAGE_SQLITE)) { Tools::logm('you don\'t have write access on sqlite file'); - $msg = '

error

You don\'t have write access on sqlite file.

'; + $this->notInstalledMessage[] = 'You don\'t have write access on sqlite file.'; + $msg = FALSE; } - if (! empty($msg)) { - $this->notInstalledMessage = $msg; - + if (! $msg) { return false; } diff --git a/index.php b/index.php index 4aebfe10..f1953c2c 100644 --- a/index.php +++ b/index.php @@ -35,7 +35,12 @@ $tpl_vars = array( if (! empty($notInstalledMessage)) { if (! Poche::$canRenderTemplates || ! Poche::$configFileAvailable) { # We cannot use Twig to display the error message - die($notInstalledMessage); + echo '

Errors

    '; + foreach ($notInstalledMessage as $message) { + echo '
  1. ' . $message . '
  2. '; + } + echo '
'; + die(); } else { # Twig is installed, put the error message in the template $tpl_file = Tools::getTplFile('error'); diff --git a/themes/default/error.twig b/themes/default/error.twig index c829d12b..99eb1ed6 100644 --- a/themes/default/error.twig +++ b/themes/default/error.twig @@ -1,6 +1,11 @@ {% extends "layout.twig" %} {% block title %}{% trans "plop" %}{% endblock %} {% block content %} - {{ msg|raw }} -

Don't forget the documentation.

+

Errors

+
    + {% for message in msg %} +
  1. {{message}}
  2. + {% endfor %} +
+

Don't forget the documentation.

{% endblock %} \ No newline at end of file -- cgit v1.2.3 From 031df528b611a5c6639c0d86636633da098d8aa2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 13:19:34 +0200 Subject: bug fix #268: move POCHE_VERSION in index.php and change the name to avoid conflicts when updating --- inc/poche/Poche.class.php | 4 +- inc/poche/config.inc.php.new | 2 - index.php | 1 + install/update_sqlite_from_0_to_1.php | 72 ------------------------------- install/update_to_1beta3.php | 79 ----------------------------------- themes/default/_footer.twig | 2 +- themes/default/config.twig | 4 +- 7 files changed, 6 insertions(+), 158 deletions(-) delete mode 100644 install/update_sqlite_from_0_to_1.php delete mode 100644 install/update_to_1beta3.php diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 899d7356..245f6a13 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -366,8 +366,8 @@ class Poche case 'config': $dev = $this->getPocheVersion('dev'); $prod = $this->getPocheVersion('prod'); - $compare_dev = version_compare(POCHE_VERSION, $dev); - $compare_prod = version_compare(POCHE_VERSION, $prod); + $compare_dev = version_compare(POCHE, $dev); + $compare_prod = version_compare(POCHE, $prod); $themes = $this->getInstalledThemes(); $tpl_vars = array( 'themes' => $themes, diff --git a/inc/poche/config.inc.php.new b/inc/poche/config.inc.php.new index 255b97e6..99223c78 100755 --- a/inc/poche/config.inc.php.new +++ b/inc/poche/config.inc.php.new @@ -49,8 +49,6 @@ define ('CACHE', ROOT . '/cache'); define ('PAGINATION', '10'); -define ('POCHE_VERSION', '1.0.0'); - define ('POCKET_FILE', '/ril_export.html'); define ('READABILITY_FILE', '/readability'); define ('INSTAPAPER_FILE', '/instapaper-export.html'); diff --git a/index.php b/index.php index f1953c2c..22696c6f 100644 --- a/index.php +++ b/index.php @@ -8,6 +8,7 @@ * @license http://www.wtfpl.net/ see COPYING file */ +define ('POCHE', '1.0.0'); require_once 'inc/poche/global.inc.php'; # Start Poche 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 299abf48..00000000 --- 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/install/update_to_1beta3.php b/install/update_to_1beta3.php deleted file mode 100644 index e0da1590..00000000 --- a/install/update_to_1beta3.php +++ /dev/null @@ -1,79 +0,0 @@ - - - - - - - - - - updating poche - - -

update poche to 1.0-beta3

- -

Changelog

-

-

    -
  • this awesome updating step
  • -
  • error message when install folder exists
  • -
  • more tests before installation (write access, etc.)
  • -
  • updated README to make installation easier
  • -
  • german language thanks to HLFH
  • -
  • spanish language thanks to Nitche
  • -
  • new file ./inc/poche/myconfig.inc.php created to store language and salt
  • -
  • #119: salt is now created when installing poche
  • -
  • #130: robots.txt added
  • -
  • #136: error during readability import
  • -
  • #137: mixed content alert in https
  • -
  • #138: change pattern to parse url with #
  • -
-

-

To update your poche, please fill the following fields.

-

-

-
-
-
-
-

-login($_POST['login'], sha1($_POST['password'] . $_POST['login'] . $old_salt)); - if ($user != array()) { - $new_salt = md5(time() . $_SERVER['SCRIPT_FILENAME'] . rand()); - $myconfig_file = '../inc/poche/myconfig.inc.php'; - if (!is_writable('../inc/poche/')) { - die('You don\'t have write access to create ./inc/poche/myconfig.inc.php.'); - } - - if (!file_exists($myconfig_file)) - { - $fp = fopen($myconfig_file, 'w'); - - fwrite($fp, 'updatePassword($user['id'], sha1($_POST['password'] . $_POST['login'] . $new_salt)); -?> -

your poche is up to date!

-

don't forget to delete ./install/ folder after the update.

-

go back to your poche

- - - \ No newline at end of file diff --git a/themes/default/_footer.twig b/themes/default/_footer.twig index 2b895854..06148a57 100644 --- a/themes/default/_footer.twig +++ b/themes/default/_footer.twig @@ -1,4 +1,4 @@

{% trans "powered by" %} poche

- {% if constant('DEBUG_POCHE') == 1 %}

{% trans "debug mode is on so cache is off." %} {% trans "your poche version:" %}{{constant('POCHE_VERSION')}}. {% trans "storage:" %} {{constant('STORAGE')}}

{% endif %} + {% if constant('DEBUG_POCHE') == 1 %}

{% trans "debug mode is on so cache is off." %} {% trans "your poche version:" %}{{constant('POCHE')}}. {% trans "storage:" %} {{constant('STORAGE')}}

{% endif %}
\ No newline at end of file diff --git a/themes/default/config.twig b/themes/default/config.twig index 0f1aea80..af8ff8ca 100644 --- a/themes/default/config.twig +++ b/themes/default/config.twig @@ -5,7 +5,7 @@ {% include '_menu.twig' %} {% endblock %} {% block content %} -

{% trans "Poching a link" %}

+

{% trans "Poching a link" %}

F

{% trans "You can poche a link by several methods:" %} (?)

  • firefox: {% trans "download the extension" %}
  • @@ -23,7 +23,7 @@

    {% trans "Updating poche" %}

    -- cgit v1.2.3 From 894c36ea32d38d425e27dae43a29dcd9e669040e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 14:00:45 +0200 Subject: what this f* F? --- themes/default/config.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/themes/default/config.twig b/themes/default/config.twig index af8ff8ca..13bdaafd 100644 --- a/themes/default/config.twig +++ b/themes/default/config.twig @@ -5,7 +5,7 @@ {% include '_menu.twig' %} {% endblock %} {% block content %} -

    {% trans "Poching a link" %}

    F +

    {% trans "Poching a link" %}

    {% trans "You can poche a link by several methods:" %} (?)

    • firefox: {% trans "download the extension" %}
    • @@ -77,4 +77,4 @@

      {% trans "Export your poche datas" %}

      {% trans "Click here" %} {% trans "to export your poche datas." %}

      -{% endblock %} \ No newline at end of file +{% endblock %} -- cgit v1.2.3 From 5011388f39432f810e397a60d9b200faba6c868b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 14:26:25 +0200 Subject: bug fix #215: change language from config screen --- inc/poche/Poche.class.php | 77 ++++++++++++++++++++++++++++++++++++++++++++++ index.php | 3 ++ themes/default/config.twig | 19 ++++++++++++ 3 files changed, 99 insertions(+) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 245f6a13..5299e374 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -20,6 +20,7 @@ class Poche public $pagination; private $currentTheme = ''; + private $currentLanguage = ''; private $notInstalledMessage = array(); # @todo make this dynamic (actually install themes and save them in the database including author information et cetera) @@ -83,6 +84,15 @@ class Poche } $this->currentTheme = $themeDirectory; + + # Set up language + $languageDirectory = $this->user->getConfigValue('language'); + + if ($languageDirectory === false) { + $languageDirectory = DEFAULT_THEME; + } + + $this->currentLanguage = $languageDirectory; } public function configFileIsAvailable() { @@ -253,6 +263,10 @@ class Poche public function getTheme() { return $this->currentTheme; } + + public function getLanguage() { + return $this->currentLanguage; + } public function getInstalledThemes() { $handle = opendir(THEME); @@ -277,6 +291,29 @@ class Poche return $themes; } + public function getInstalledLanguages() { + $handle = opendir(LOCALE); + $languages = array(); + + while (($language = readdir($handle)) !== false) { + # Languages are stored in a directory, so all directory names are languages + # @todo move language installation data to database + if (! is_dir(LOCALE . '/' . $language) || in_array($language, array('..', '.'))) { + continue; + } + + $current = false; + + if ($language === $this->getLanguage()) { + $current = true; + } + + $languages[] = array('name' => $language, 'current' => $current); + } + + return $languages; + } + public function getDefaultConfig() { return array( @@ -369,8 +406,10 @@ class Poche $compare_dev = version_compare(POCHE, $dev); $compare_prod = version_compare(POCHE, $prod); $themes = $this->getInstalledThemes(); + $languages = $this->getInstalledLanguages(); $tpl_vars = array( 'themes' => $themes, + 'languages' => $languages, 'dev' => $dev, 'prod' => $prod, 'compare_dev' => $compare_dev, @@ -495,6 +534,44 @@ class Poche Tools::redirect('?view=config'); } + public function updateLanguage() + { + # no data + if (empty($_POST['language'])) { + } + + # we are not going to change it to the current language... + if ($_POST['language'] == $this->getLanguage()) { + $this->messages->add('w', _('still using the "' . $this->getLanguage() . '" language!')); + Tools::redirect('?view=config'); + } + + $languages = $this->getInstalledLanguages(); + $actualLanguage = false; + + foreach ($languages as $language) { + if ($language['name'] == $_POST['language']) { + $actualLanguage = true; + break; + } + } + + if (! $actualLanguage) { + $this->messages->add('e', _('that language does not seem to be installed')); + Tools::redirect('?view=config'); + } + + $this->store->updateUserConfig($this->user->getId(), 'language', $_POST['language']); + $this->messages->add('s', _('you have changed your language preferences')); + + $currentConfig = $_SESSION['poche_user']->config; + $currentConfig['language'] = $_POST['language']; + + $_SESSION['poche_user']->setConfig($currentConfig); + + Tools::redirect('?view=config'); + } + /** * checks if login & password are correct and save the user in session. * it redirects the user to the $referer link diff --git a/index.php b/index.php index 22696c6f..a6459270 100644 --- a/index.php +++ b/index.php @@ -67,7 +67,10 @@ if (isset($_GET['login'])) { $poche->export(); } elseif (isset($_GET['updatetheme'])) { $poche->updateTheme(); +} elseif (isset($_GET['updatelanguage'])) { + $poche->updateLanguage(); } + elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { $plain_url = new Url(base64_encode($_GET['plainurl'])); $poche->action('add', $plain_url); diff --git a/themes/default/config.twig b/themes/default/config.twig index 13bdaafd..23860ebd 100644 --- a/themes/default/config.twig +++ b/themes/default/config.twig @@ -47,6 +47,25 @@ +

      {% trans "Change your language" %}

      +
      +
      +
      + + +
      +
      + +
      +
      + + +
      +

      {% trans "Change your password" %}

      -- cgit v1.2.3 From 1e98ee1de08d319facfa4c74d87c51506c662b78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Mon, 7 Oct 2013 14:56:21 +0200 Subject: bug fix: changing password was buggy --- inc/poche/Database.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 0662581b..5c40b026 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -108,8 +108,8 @@ class Database { public function updatePassword($userId, $password) { $sql_update = "UPDATE users SET password=? WHERE id=?"; - $params_update = array($password, $id); - $this->updateUserConfig($userId, 'password', $password); + $params_update = array($password, $userId); + $query = $this->executeQuery($sql_update, $params_update); } public function updateUserConfig($userId, $key, $value) { -- cgit v1.2.3 From 1745ebc832ce9a1be4cb23e7a10e65fae3d96411 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Saad-Dupuy Date: Tue, 8 Oct 2013 12:56:32 +0200 Subject: Added Roboto font from https://themes.googleusercontent.com/static/fonts/roboto/v9/2UX7WLTfW3W8TclTUvlFyQ.woff --- themes/default/fonts/Roboto.woff | Bin 0 -> 22172 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 themes/default/fonts/Roboto.woff diff --git a/themes/default/fonts/Roboto.woff b/themes/default/fonts/Roboto.woff new file mode 100644 index 00000000..1440b1be Binary files /dev/null and b/themes/default/fonts/Roboto.woff differ -- cgit v1.2.3 From 272600ff80556e328a2f53dd36dacf0000e5c557 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Saad-Dupuy Date: Tue, 8 Oct 2013 12:57:33 +0200 Subject: Removed google font link --- themes/default/_head.twig | 1 - 1 file changed, 1 deletion(-) diff --git a/themes/default/_head.twig b/themes/default/_head.twig index 247b929e..d0cbd320 100644 --- a/themes/default/_head.twig +++ b/themes/default/_head.twig @@ -7,5 +7,4 @@ - -- cgit v1.2.3 From 2f3425dff699dee249bd223ad564395e254552f4 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Saad-Dupuy Date: Tue, 8 Oct 2013 13:00:43 +0200 Subject: Added font-face linked to local font --- themes/default/css/style.css | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/themes/default/css/style.css b/themes/default/css/style.css index 3ef9c823..670eb50f 100644 --- a/themes/default/css/style.css +++ b/themes/default/css/style.css @@ -1,3 +1,12 @@ +@font-face { + font-family: 'Roboto'; + font-style: normal; + font-weight: 400; + src: local('Roboto Regular'), local('Roboto-Regular'), url(../fonts/Roboto.woff) format('woff'); +} + + + body { margin: 10px; font-family: 'Roboto',Verdana,Geneva,sans-serif; @@ -318,4 +327,4 @@ a.link span, a.bad-display span, a.reading-time span { background-repeat: no-repeat; -} \ No newline at end of file +} -- cgit v1.2.3 From e231f3f023e41cd6694ed01e95e22d2d4b9fc441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 8 Oct 2013 13:37:46 +0200 Subject: add czech locale, thanks to @dstancl --- locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo | Bin 0 -> 4826 bytes locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po | 233 ++++++++++++++++++++++++++++ 2 files changed, 233 insertions(+) create mode 100644 locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo create mode 100644 locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po diff --git a/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo b/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo new file mode 100644 index 00000000..bdf19250 Binary files /dev/null and b/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.mo differ diff --git a/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po b/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po new file mode 100644 index 00000000..a99d3903 --- /dev/null +++ b/locale/cs_CZ.utf8/LC_MESSAGES/cs_CZ.utf8.po @@ -0,0 +1,233 @@ +# +# Translators: +# David Štancl , 2013 +msgid "" +msgstr "" +"Project-Id-Version: poche\n" +"POT-Creation-Date: \n" +"PO-Revision-Date: 2013-10-08 13:25+0100\n" +"Last-Translator: Nicolas Lœuillet \n" +"Language-Team: Czech (http://www.transifex.com/projects/p/poche/language/" +"cs/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Language: cs\n" +"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n" +"X-Generator: Poedit 1.5.4\n" + +msgid "config" +msgstr "nastavení" + +msgid "Poching a link" +msgstr "Odkaz se ukládá" + +msgid "read the documentation" +msgstr "číst dokumentaci" + +msgid "by filling this field" +msgstr "vyplněním tohoto pole" + +msgid "poche it!" +msgstr "uložit!" + +msgid "Updating poche" +msgstr "Poche se aktualizuje" + +msgid "your version" +msgstr "vaše verze" + +msgid "latest stable version" +msgstr "poslední stabilní verze" + +msgid "a more recent stable version is available." +msgstr "je k dispozici novější stabilní verze." + +msgid "you are up to date." +msgstr "je aktuální" + +msgid "latest dev version" +msgstr "poslední vývojová verze" + +msgid "a more recent development version is available." +msgstr "je k dispozici novější vývojová verze." + +msgid "Change your password" +msgstr "Změnit heslo" + +msgid "New password:" +msgstr "Nové heslo:" + +msgid "Password" +msgstr "Heslo" + +msgid "Repeat your new password:" +msgstr "Znovu nové heslo:" + +msgid "Update" +msgstr "Aktualizovat" + +msgid "Import" +msgstr "Importovat" + +msgid "Please execute the import script locally, it can take a very long time." +msgstr "Spusťte importní skript lokálně, může to dlouho trvat." + +msgid "More infos in the official doc:" +msgstr "Více informací v oficiální dokumentaci:" + +msgid "import from Pocket" +msgstr "importovat z Pocket" + +msgid "import from Readability" +msgstr "importovat z Readability" + +msgid "import from Instapaper" +msgstr "importovat z Instapaper" + +msgid "Export your poche datas" +msgstr "Export dat" + +msgid "Click here" +msgstr "Klikněte zde" + +msgid "to export your poche datas." +msgstr "pro export vašich dat." + +msgid "back to home" +msgstr "zpět na úvod" + +msgid "installation" +msgstr "instalace" + +msgid "install your poche" +msgstr "instalovat" + +msgid "" +"poche is still not installed. Please fill the below form to install it. " +"Don't hesitate to read the documentation " +"on poche website." +msgstr "" +"poche ještě není nainstalováno. Pro instalaci vyplňte níže uvedený formulář. " +"Nezapomeňte si přečíst dokumentaci " +"na stránkách programu." + +msgid "Login" +msgstr "Jméno" + +msgid "Repeat your password" +msgstr "Zopakujte heslo" + +msgid "Install" +msgstr "Instalovat" + +msgid "back to top" +msgstr "zpět na začátek" + +msgid "favoris" +msgstr "oblíbené" + +msgid "archive" +msgstr "archív" + +msgid "unread" +msgstr "nepřečtené" + +msgid "by date asc" +msgstr "podle data od nejstarších" + +msgid "by date" +msgstr "podle data" + +msgid "by date desc" +msgstr "podle data od nejnovějších" + +msgid "by title asc" +msgstr "podle nadpisu vzestupně" + +msgid "by title" +msgstr "podle nadpisu" + +msgid "by title desc" +msgstr "podle nadpisu sestupně" + +msgid "No link available here!" +msgstr "Není k dispozici žádný odkaz!" + +msgid "toggle mark as read" +msgstr "označit jako přečtené" + +msgid "toggle favorite" +msgstr "označit jako oblíbené" + +msgid "delete" +msgstr "smazat" + +msgid "original" +msgstr "originál" + +msgid "results" +msgstr "výsledky" + +msgid "tweet" +msgstr "tweetnout" + +msgid "email" +msgstr "email" + +msgid "shaarli" +msgstr "shaarli" + +msgid "flattr" +msgstr "flattr" + +msgid "this article appears wrong?" +msgstr "vypadá tento článek špatně?" + +msgid "create an issue" +msgstr "odeslat požadavek" + +msgid "or" +msgstr "nebo" + +msgid "contact us by mail" +msgstr "kontaktovat e-mailem" + +msgid "plop" +msgstr "" + +msgid "home" +msgstr "domů" + +msgid "favorites" +msgstr "oblíbené" + +msgid "logout" +msgstr "odhlásit se" + +msgid "powered by" +msgstr "běží na" + +msgid "debug mode is on so cache is off." +msgstr "je zapnut ladicí mód, proto je keš vypnuta." + +msgid "your poche version:" +msgstr "verze:" + +msgid "storage:" +msgstr "úložiště:" + +msgid "login to your poche" +msgstr "přihlásit se k poche" + +msgid "you are in demo mode, some features may be disabled." +msgstr "používáte ukázkový mód, některé funkce jsou zakázány." + +msgid "Stay signed in" +msgstr "Zůstat přihlášen(a)" + +msgid "(Do not check on public computers)" +msgstr "(Nezaškrtávejte na veřejně dostupných počítačích)" + +msgid "Sign in" +msgstr "Přihlásit se" -- cgit v1.2.3 From 18889e230a80b7c45b30036c86896e6a2f9cacf5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 10 Oct 2013 14:06:53 +0200 Subject: remove empty file --- inc/3rdparty/site_config/custom/palkeo.com.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 inc/3rdparty/site_config/custom/palkeo.com.txt diff --git a/inc/3rdparty/site_config/custom/palkeo.com.txt b/inc/3rdparty/site_config/custom/palkeo.com.txt deleted file mode 100644 index e69de29b..00000000 -- cgit v1.2.3 From a84f77d6ba15a64ff00453f5d5190c021ce460ed Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Sun, 13 Oct 2013 20:39:12 +0200 Subject: Updated Screenshots URLs From the poche-themes repository to the poche repository, folder themes. --- themes/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/themes/README.md b/themes/README.md index 76ac8ab0..9e5d6560 100644 --- a/themes/README.md +++ b/themes/README.md @@ -4,10 +4,10 @@ themes created by poche users ## list of themes -* dark ([preview](https://raw.github.com/inthepoche/poche-themes/master/dark/screenshot.jpg)) -* dmagenta ([preview](https://raw.github.com/inthepoche/poche-themes/master/dmagenta/screenshot.jpg)) -* solarized ([preview](https://raw.github.com/inthepoche/poche-themes/master/solarized/screenshot.jpg)) -* solarized-dark ([preview](https://raw.github.com/inthepoche/poche-themes/master/solarized-dark/screenshot.jpg)) +* dark ([preview](https://raw.github.com/inthepoche/poche/master/themes/dark/screenshot.jpg)) +* dmagenta ([preview](https://raw.github.com/inthepoche/poche/master/themes/dmagenta/screenshot.jpg)) +* solarized ([preview](https://raw.github.com/inthepoche/poche/master/themes/solarized/screenshot.jpg)) +* solarized-dark ([preview](https://raw.github.com/inthepoche/poche/master/themes/solarized-dark/screenshot.jpg)) ## installation -- cgit v1.2.3 From 36b92198425618a098941494000e21935208cb90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 17 Oct 2013 17:03:55 +0200 Subject: bug fix #251: login failure --- index.php | 1 + 1 file changed, 1 insertion(+) diff --git a/index.php b/index.php index a6459270..fdcfc328 100644 --- a/index.php +++ b/index.php @@ -10,6 +10,7 @@ define ('POCHE', '1.0.0'); require_once 'inc/poche/global.inc.php'; +session_start(); # Start Poche $poche = new Poche(); -- cgit v1.2.3 From df6afaf0909506a334ef2b8c6f69770cd9890e0d Mon Sep 17 00:00:00 2001 From: Denis Sacchet Date: Sun, 20 Oct 2013 16:53:54 +0200 Subject: Added support for http_auth --- inc/poche/Poche.class.php | 35 +++++++++++++++++++++++++++-------- index.php | 4 +++- themes/default/config.twig | 2 ++ 3 files changed, 32 insertions(+), 9 deletions(-) diff --git a/inc/poche/Poche.class.php b/inc/poche/Poche.class.php index 806da54b..0766cd51 100644 --- a/inc/poche/Poche.class.php +++ b/inc/poche/Poche.class.php @@ -408,6 +408,7 @@ class Poche $compare_prod = version_compare(POCHE, $prod); $themes = $this->getInstalledThemes(); $languages = $this->getInstalledLanguages(); + $http_auth = (isset($_SERVER['PHP_AUTH_USER']))?true:false; $tpl_vars = array( 'themes' => $themes, 'languages' => $languages, @@ -415,6 +416,7 @@ class Poche 'prod' => $prod, 'compare_dev' => $compare_dev, 'compare_prod' => $compare_prod, + 'http_auth' => $http_auth, ); Tools::logm('config view'); break; @@ -573,6 +575,21 @@ class Poche Tools::redirect('?view=config'); } + /** + * get credentials from differents sources + * it redirects the user to the $referer link + * @return array + */ + private function credentials() { + if(isset($_SERVER['PHP_AUTH_USER'])) { + return array($_SERVER['PHP_AUTH_USER'],'php_auth'); + } + if(!empty($_POST['login']) && !empty($_POST['password'])) { + return array($_POST['login'],$_POST['password']); + } + return array(false,false); + } + /** * checks if login & password are correct and save the user in session. * it redirects the user to the $referer link @@ -582,11 +599,17 @@ class Poche */ public function login($referer) { - if (!empty($_POST['login']) && !empty($_POST['password'])) { - $user = $this->store->login($_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login'])); + list($login,$password)=$this->credentials(); + if($login === false || $password === false) { + $this->messages->add('e', _('login failed: you have to fill all fields')); + Tools::logm('login failed'); + Tools::redirect(); + } + if (!empty($login) && !empty($password)) { + $user = $this->store->login($login, Tools::encodeString($password . $login)); if ($user != array()) { # Save login into Session - Session::login($user['username'], $user['password'], $_POST['login'], Tools::encodeString($_POST['password'] . $_POST['login']), array('poche_user' => new User($user))); + Session::login($user['username'], $user['password'], $login, Tools::encodeString($password . $login), array('poche_user' => new User($user))); $this->messages->add('s', _('welcome to your poche')); Tools::logm('login successful'); Tools::redirect($referer); @@ -594,10 +617,6 @@ class Poche $this->messages->add('e', _('login failed: bad login or password')); Tools::logm('login failed'); Tools::redirect(); - } else { - $this->messages->add('e', _('login failed: you have to fill all fields')); - Tools::logm('login failed'); - Tools::redirect(); } } @@ -814,4 +833,4 @@ class Poche } return $version; } -} \ No newline at end of file +} diff --git a/index.php b/index.php index fdcfc328..d79f3f95 100644 --- a/index.php +++ b/index.php @@ -81,6 +81,8 @@ if (Session::isLogged()) { $poche->action($action, $url, $id); $tpl_file = Tools::getTplFile($view); $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id)); +} elseif(isset($_SERVER['PHP_AUTH_USER'])) { + $poche->login($referer); } else { $tpl_file = Tools::getTplFile('login'); } @@ -90,4 +92,4 @@ $messages = $poche->messages->display('all', FALSE); $tpl_vars = array_merge($tpl_vars, array('messages' => $messages)); # display poche -echo $poche->tpl->render($tpl_file, $tpl_vars); \ No newline at end of file +echo $poche->tpl->render($tpl_file, $tpl_vars); diff --git a/themes/default/config.twig b/themes/default/config.twig index 23860ebd..72671702 100644 --- a/themes/default/config.twig +++ b/themes/default/config.twig @@ -66,6 +66,7 @@ + {% if http_auth == 0 %}

      {% trans "Change your password" %}

      @@ -84,6 +85,7 @@ + {% endif %}

      {% trans "Import" %}

      {% trans "Please execute the import script locally, it can take a very long time." %}

      -- cgit v1.2.3 From 027b4e156853b4d5e358e19e83506ec4446de7ab Mon Sep 17 00:00:00 2001 From: Denis Sacchet Date: Sun, 20 Oct 2013 23:28:45 +0200 Subject: Adding support for http_auth --- inc/poche/Database.class.php | 11 +++++++++++ index.php | 10 +++++++++- themes/default/login.twig | 4 +++- 3 files changed, 23 insertions(+), 2 deletions(-) diff --git a/inc/poche/Database.class.php b/inc/poche/Database.class.php index 5c40b026..1d3ff0c2 100644 --- a/inc/poche/Database.class.php +++ b/inc/poche/Database.class.php @@ -87,6 +87,17 @@ class Database { return $user_config; } + public function userExists($username) { + $sql = "SELECT * FROM users WHERE username=?"; + $query = $this->executeQuery($sql, array($username)); + $login = $query->fetchAll(); + if (isset($login[0])) { + return true; + } else { + return false; + } + } + public function login($username, $password) { $sql = "SELECT * FROM users WHERE username=? AND password=?"; $query = $this->executeQuery($sql, array($username, $password)); diff --git a/index.php b/index.php index d79f3f95..d400354d 100644 --- a/index.php +++ b/index.php @@ -82,9 +82,17 @@ if (Session::isLogged()) { $tpl_file = Tools::getTplFile($view); $tpl_vars = array_merge($tpl_vars, $poche->displayView($view, $id)); } elseif(isset($_SERVER['PHP_AUTH_USER'])) { - $poche->login($referer); + if($poche->store->userExists($_SERVER['PHP_AUTH_USER'])) { + $poche->login($referer); + } else { + $poche->messages->add('e', _('login failed: user doesn\'t exist')); + Tools::logm('user doesn\'t exist'); + $tpl_file = Tools::getTplFile('login'); + $tpl_vars['http_auth'] = 1; + } } else { $tpl_file = Tools::getTplFile('login'); + $tpl_vars['http_auth'] = 0; } # because messages can be added in $poche->action(), we have to add this entry now (we can add it before) diff --git a/themes/default/login.twig b/themes/default/login.twig index 0ae130bc..2e48052b 100644 --- a/themes/default/login.twig +++ b/themes/default/login.twig @@ -2,6 +2,7 @@ {% block title %}{% trans "login to your poche" %}{% endblock %} {% block content %} + {% if http_auth == 0 %}

      {% trans "login to your poche" %}

      @@ -29,4 +30,5 @@ -{% endblock %} \ No newline at end of file + {% endif %} +{% endblock %} -- cgit v1.2.3 From 1a0d776394d7e10b5e017f00d3626e3de6ba3688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Tue, 22 Oct 2013 08:51:22 +0200 Subject: fix #286: german translation updated --- locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo | Bin 4216 -> 4779 bytes locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po | 106 ++++++++++++++-------------- 2 files changed, 53 insertions(+), 53 deletions(-) diff --git a/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo b/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo index 54626a55..cf8ae292 100644 Binary files a/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo and b/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.mo differ diff --git a/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po b/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po index 2de43b41..14aeb0f5 100644 --- a/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po +++ b/locale/de_DE.utf8/LC_MESSAGES/de_DE.utf8.po @@ -3,51 +3,51 @@ msgstr "" "Project-Id-Version: \n" "POT-Creation-Date: \n" "PO-Revision-Date: \n" -"Last-Translator: Nicolas Lœuillet \n" +"Last-Translator: Square252\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 1.5.4\n" +"X-Generator: Poedit 1.5.7\n" msgid "config" -msgstr "Konfig" +msgstr "Konfiguration" msgid "Poching a link" -msgstr "" +msgstr "Poche einen Link" msgid "read the documentation" -msgstr "" +msgstr "Die Dokumentation lesen" msgid "by filling this field" -msgstr "" +msgstr "durch das ausfüllen dieses Feldes:" msgid "poche it!" -msgstr "Pochert es!" +msgstr "Poche es!" msgid "Updating poche" msgstr "Poche aktualisieren" msgid "your version" -msgstr "Ihre Version" +msgstr "Deine Version" msgid "latest stable version" -msgstr "letzte stabile Version" +msgstr "Neuste stabile Version" msgid "a more recent stable version is available." -msgstr "eine neuere stabile Version ist verfügbar." +msgstr "Eine neuere stabile Version ist verfügbar." msgid "you are up to date." -msgstr "Sie sind auf den neuesten Stand." +msgstr "Du bist auf den neuesten Stand." msgid "latest dev version" -msgstr "letzte Entwicklungsversion" +msgstr "Neuste Entwicklungsversion" msgid "a more recent development version is available." -msgstr "eine neuere Entwicklungsversion ist verfügbar." +msgstr "Eine neuere Entwicklungsversion ist verfügbar." msgid "Change your password" -msgstr "Ihr Passwort ändern" +msgstr "Passwort ändern" msgid "New password:" msgstr "Neues Passwort:" @@ -56,7 +56,7 @@ msgid "Password" msgstr "Passwort" msgid "Repeat your new password:" -msgstr "neues Passwort wiederholen:" +msgstr "Neues Passwort wiederholen:" msgid "Update" msgstr "Aktualisieren" @@ -65,114 +65,113 @@ msgid "Import" msgstr "Import" msgid "Please execute the import script locally, it can take a very long time." -msgstr "" -"Wir danken Ihnen, den Import in lokal zu ausführen, kann es einige Zeit " -"dauern." +msgstr "Bitte führe das Import Script lokal aus, dies kann eine Weile dauern." msgid "More infos in the official doc:" -msgstr "Mehr Informationen auf der offiziellen Dokumentation:" +msgstr "Mehr Informationen in der offiziellen Dokumentation:" msgid "import from Pocket" -msgstr "import aus Pocket" +msgstr "Import aus Pocket" msgid "import from Readability" -msgstr "import aus Readability" +msgstr "Import aus Readability" msgid "import from Instapaper" -msgstr "import aus Instapaper" +msgstr "Import aus Instapaper" msgid "Export your poche datas" -msgstr "Exportieren Sie Ihre Daten aus Poche." +msgstr "Exportieren Sie Ihre Poche Daten." msgid "Click here" -msgstr "klicken Sie hier" +msgstr "Klicke hier" msgid "to export your poche datas." -msgstr "um Ihre Daten aus Poche zu exportieren." +msgstr "um deine Daten aus Poche zu exportieren." msgid "back to home" msgstr "züruck zur Hauptseite" msgid "installation" -msgstr "Installierung" +msgstr "Installieren" msgid "install your poche" -msgstr "installieren Sie Poche" +msgstr "Installiere dein Poche" msgid "" "poche is still not installed. Please fill the below form to install it. " "Don't hesitate to read the documentation " "on poche website." msgstr "" -"Poche ist noch nicht installiert. Wir danken Ihnen, die Felder unten zu " -"befüllen, um es zu machen. Zögern sie nicht, die Dokumentation auf der Website von Poche zu lesen." +"Poche ist noch nicht installiert. Bitte fülle die Felder unten aus, um die " +"Installation durchzuführen. Zögere nicht, die Dokumentation auf der Website von Poche zu lesen falls du Probleme " +"haben solltest." msgid "Login" msgstr "Benutzername" msgid "Repeat your password" -msgstr "Wiederholen Sie Ihr Passwort" +msgstr "Wiederhole dein Passwort" msgid "Install" msgstr "Installieren" msgid "back to top" -msgstr "zurück nach oben" +msgstr "Nach Oben" msgid "favoris" msgstr "" msgid "archive" -msgstr "Archive" +msgstr "Archiv" msgid "unread" -msgstr "" +msgstr "ungelesen" msgid "by date asc" -msgstr "nach Datum asc" +msgstr "nach Datum aufsteigend" msgid "by date" msgstr "nach Datum" msgid "by date desc" -msgstr "nach Datum desc" +msgstr "nach Datum absteigend" msgid "by title asc" -msgstr "nach Titel asc" +msgstr "nach Titel aufsteigend" msgid "by title" msgstr "nach Titel" msgid "by title desc" -msgstr "nach Titel desc" +msgstr "nach Titel absteigend" msgid "No link available here!" -msgstr "" +msgstr "Kein Link verfügbar!" msgid "toggle mark as read" -msgstr "als gelesen markieren" +msgstr "Als gelesen markieren" msgid "toggle favorite" msgstr "Favorit" msgid "delete" -msgstr "löschen" +msgstr "Löschen" msgid "original" msgstr "Original" msgid "results" -msgstr "" +msgstr "Ergebnisse" msgid "tweet" -msgstr "twittern" +msgstr "Twittern" msgid "email" msgstr "senden per E-Mail" msgid "shaarli" -msgstr "shaarli" +msgstr "Shaarli" msgid "flattr" msgstr "flattr" @@ -193,37 +192,38 @@ msgid "plop" msgstr "plop" msgid "home" -msgstr "Hause" +msgstr "Start" msgid "favorites" msgstr "Favoriten" msgid "logout" -msgstr "Trennung" +msgstr "Logout" msgid "powered by" msgstr "bereitgestellt von" msgid "debug mode is on so cache is off." -msgstr "" +msgstr "Debug Modus ist aktiviert, das Caching ist somit deaktiviert" msgid "your poche version:" -msgstr "" +msgstr "Deine Poche Version" msgid "storage:" -msgstr "" +msgstr "Speicher:" msgid "login to your poche" -msgstr "Verbinden zu Poche" +msgstr "Bei Poche anmelden" msgid "you are in demo mode, some features may be disabled." -msgstr "Sie sind im Demomodus, können einige Funktionen deaktiviert werden." +msgstr "" +"Du befindest dich im Demomodus, einige Funktionen könnten deaktiviert sein." msgid "Stay signed in" -msgstr "bleiben Sie verbunden" +msgstr "Angemeldet bleiben" msgid "(Do not check on public computers)" -msgstr "(nicht auf einem öffentlichen Computer überprüfen)" +msgstr "(nicht auf einem öffentlichen Computer anhaken)" msgid "Sign in" msgstr "Einloggen" -- cgit v1.2.3 From 6ae804853f6f2e10d394b6abfb977b7a251ee7e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 25 Oct 2013 08:45:28 +0200 Subject: on the road to 1.1.0 --- index.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.php b/index.php index d400354d..66a2e816 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,7 @@ * @license http://www.wtfpl.net/ see COPYING file */ -define ('POCHE', '1.0.0'); +define ('POCHE', '1.1.0'); require_once 'inc/poche/global.inc.php'; session_start(); -- cgit v1.2.3