diff options
author | Thomas Citharel <tcit@tcit.fr> | 2014-08-26 12:43:56 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2014-08-26 12:43:56 +0200 |
commit | 8763e4efde17f133d0bda504640acada108e7870 (patch) | |
tree | 60a58a84b0d8c245b9ae8a4294239d4d5f537671 | |
parent | 4362417495b116b6bd4c3011187968f68f09430f (diff) | |
download | wallabag-8763e4efde17f133d0bda504640acada108e7870.tar.gz wallabag-8763e4efde17f133d0bda504640acada108e7870.tar.zst wallabag-8763e4efde17f133d0bda504640acada108e7870.zip |
Fix downloading SQLite database from all users
-rwxr-xr-x | inc/poche/Routing.class.php | 2 | ||||
-rwxr-xr-x | inc/poche/Tools.class.php | 20 | ||||
-rwxr-xr-x | themes/baggy/config.twig | 2 | ||||
-rwxr-xr-x | themes/default/config.twig | 1 |
4 files changed, 11 insertions, 14 deletions
diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index 004bd45a..0b373058 100755 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php | |||
@@ -124,8 +124,6 @@ class Routing | |||
124 | } elseif (isset($_GET['import'])) { | 124 | } elseif (isset($_GET['import'])) { |
125 | $import = $this->wallabag->import(); | 125 | $import = $this->wallabag->import(); |
126 | $tplVars = array_merge($this->vars, $import); | 126 | $tplVars = array_merge($this->vars, $import); |
127 | } elseif (isset($_GET['download'])) { | ||
128 | Tools::downloadDb(); | ||
129 | } elseif (isset($_GET['empty-cache'])) { | 127 | } elseif (isset($_GET['empty-cache'])) { |
130 | Tools::emptyCache(); | 128 | Tools::emptyCache(); |
131 | } elseif (isset($_GET['export'])) { | 129 | } elseif (isset($_GET['export'])) { |
diff --git a/inc/poche/Tools.class.php b/inc/poche/Tools.class.php index 63137d76..c2c1bdab 100755 --- a/inc/poche/Tools.class.php +++ b/inc/poche/Tools.class.php | |||
@@ -296,18 +296,20 @@ final class Tools | |||
296 | 296 | ||
297 | /** | 297 | /** |
298 | * Download the sqlite database | 298 | * Download the sqlite database |
299 | * Function not longer used for security reasons | ||
299 | */ | 300 | */ |
300 | public static function downloadDb() | ||
301 | { | ||
302 | header('Content-Disposition: attachment; filename="poche.sqlite.gz"'); | ||
303 | self::_status(200); | ||
304 | 301 | ||
305 | header('Content-Transfer-Encoding: binary'); | 302 | // public static function downloadDb() |
306 | header('Content-Type: application/octet-stream'); | 303 | // { |
307 | echo gzencode(file_get_contents(STORAGE_SQLITE)); | 304 | // header('Content-Disposition: attachment; filename="poche.sqlite.gz"'); |
305 | // self::_status(200); | ||
308 | 306 | ||
309 | exit; | 307 | // header('Content-Transfer-Encoding: binary'); |
310 | } | 308 | // header('Content-Type: application/octet-stream'); |
309 | // echo gzencode(file_get_contents(STORAGE_SQLITE)); | ||
310 | |||
311 | // exit; | ||
312 | // } | ||
311 | 313 | ||
312 | /** | 314 | /** |
313 | * Get the content for a given URL (by a call to FullTextFeed) | 315 | * Get the content for a given URL (by a call to FullTextFeed) |
diff --git a/themes/baggy/config.twig b/themes/baggy/config.twig index e45c3218..7bd229cb 100755 --- a/themes/baggy/config.twig +++ b/themes/baggy/config.twig | |||
@@ -121,8 +121,6 @@ | |||
121 | <p><a href="?import">{% trans "You can click here to fetch content for articles with no content." %}</a></p> | 121 | <p><a href="?import">{% trans "You can click here to fetch content for articles with no content." %}</a></p> |
122 | 122 | ||
123 | <h2>{% trans "Export your wallabag data" %}</h2> | 123 | <h2>{% trans "Export your wallabag data" %}</h2> |
124 | {% if constant('STORAGE') == 'sqlite' %} | ||
125 | <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %} | ||
126 | <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> | 124 | <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> |
127 | 125 | ||
128 | <h2>{% trans "Fancy an E-Book ?" %}</h2> | 126 | <h2>{% trans "Fancy an E-Book ?" %}</h2> |
diff --git a/themes/default/config.twig b/themes/default/config.twig index 8f047ae6..5656fadd 100755 --- a/themes/default/config.twig +++ b/themes/default/config.twig | |||
@@ -121,7 +121,6 @@ | |||
121 | 121 | ||
122 | <h2>{% trans "Export your wallabag data" %}</h2> | 122 | <h2>{% trans "Export your wallabag data" %}</h2> |
123 | {% if constant('STORAGE') == 'sqlite' %} | 123 | {% if constant('STORAGE') == 'sqlite' %} |
124 | <p><a href="?download" target="_blank">{% trans "Click here" %}</a> {% trans "to download your database." %}</p>{% endif %} | ||
125 | <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> | 124 | <p><a href="?export" target="_blank">{% trans "Click here" %}</a> {% trans "to export your wallabag data." %}</p> |
126 | 125 | ||
127 | <h2>{% trans "Cache" %}</h2> | 126 | <h2>{% trans "Cache" %}</h2> |