From c70bfefc68fcc96b1ce57845e5b2942a596239ec Mon Sep 17 00:00:00 2001 From: tcit Date: Thu, 24 Jul 2014 15:59:08 +0200 Subject: add mobi and pdf to routing --- inc/poche/Routing.class.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'inc/poche/Routing.class.php') diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index 2db57d12..e01d8129 100644 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -112,7 +112,13 @@ class Routing $this->wallabag->deleteUser($_POST['password4deletinguser']); } elseif (isset($_GET['epub'])) { $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['value']); - $epub->run(); + $epub->produceEpub(); + } elseif (isset($_GET['mobi'])) { + $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); + $mobi->produceMobi(); + } elseif (isset($_GET['pdf'])) { + $pdf = new WallabagPDF($this->wallabag, $_GET['method'], $_GET['value']); + $pdf->producePDF(); } elseif (isset($_GET['import'])) { $import = $this->wallabag->import(); $tplVars = array_merge($this->vars, $import); -- cgit v1.2.3 From fb9df0c269f36703909b8b259abbdbed29881ecd Mon Sep 17 00:00:00 2001 From: tcit Date: Thu, 24 Jul 2014 21:56:04 +0200 Subject: use directly MOBIClass --- inc/poche/Routing.class.php | 3 +++ 1 file changed, 3 insertions(+) (limited to 'inc/poche/Routing.class.php') diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index e01d8129..83eabf19 100644 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -112,12 +112,15 @@ class Routing $this->wallabag->deleteUser($_POST['password4deletinguser']); } elseif (isset($_GET['epub'])) { $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['value']); + $epub->prepareData(); $epub->produceEpub(); } elseif (isset($_GET['mobi'])) { $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); + $mobi->prepareData(); $mobi->produceMobi(); } elseif (isset($_GET['pdf'])) { $pdf = new WallabagPDF($this->wallabag, $_GET['method'], $_GET['value']); + $pdf->prepareData(); $pdf->producePDF(); } elseif (isset($_GET['import'])) { $import = $this->wallabag->import(); -- cgit v1.2.3 From dc59f164a94ce2ab9e3165aa0090acff8a352493 Mon Sep 17 00:00:00 2001 From: tcit Date: Fri, 25 Jul 2014 01:33:31 +0200 Subject: send2kindle --- inc/poche/Routing.class.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'inc/poche/Routing.class.php') diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index 83eabf19..ec33432c 100644 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -118,6 +118,10 @@ class Routing $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); $mobi->prepareData(); $mobi->produceMobi(); + } elseif (isset($_GET['send2kindle'])) { + $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); + $mobi->prepareData(); + $mobi->produceMobi(TRUE); } elseif (isset($_GET['pdf'])) { $pdf = new WallabagPDF($this->wallabag, $_GET['method'], $_GET['value']); $pdf->prepareData(); -- cgit v1.2.3 From a1b31d93b69c78db0ebc0635b619b02ee7392957 Mon Sep 17 00:00:00 2001 From: tcit Date: Sat, 27 Sep 2014 19:42:37 +0200 Subject: get up to date --- inc/poche/Routing.class.php | 92 ++++++++++++++++++++------------------------- 1 file changed, 40 insertions(+), 52 deletions(-) mode change 100644 => 100755 inc/poche/Routing.class.php (limited to 'inc/poche/Routing.class.php') diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php old mode 100644 new mode 100755 index ec33432c..0b373058 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -98,62 +98,50 @@ class Routing private function _launchAction() { if (isset($_GET['login'])) { - // hello you - $this->wallabag->login($this->referer); - } elseif (isset($_GET['logout'])) { - // see you soon ! - $this->wallabag->logout(); - } elseif (isset($_GET['config'])) { - // update password - $this->wallabag->updatePassword($_POST['password'], $_POST['password_repeat']); - } elseif (isset($_GET['newuser'])) { - $this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser']); - } elseif (isset($_GET['deluser'])) { - $this->wallabag->deleteUser($_POST['password4deletinguser']); - } elseif (isset($_GET['epub'])) { - $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['value']); - $epub->prepareData(); - $epub->produceEpub(); - } elseif (isset($_GET['mobi'])) { - $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); - $mobi->prepareData(); - $mobi->produceMobi(); - } elseif (isset($_GET['send2kindle'])) { - $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); - $mobi->prepareData(); - $mobi->produceMobi(TRUE); - } elseif (isset($_GET['pdf'])) { - $pdf = new WallabagPDF($this->wallabag, $_GET['method'], $_GET['value']); - $pdf->prepareData(); - $pdf->producePDF(); - } elseif (isset($_GET['import'])) { - $import = $this->wallabag->import(); - $tplVars = array_merge($this->vars, $import); - } elseif (isset($_GET['download'])) { - Tools::downloadDb(); - } elseif (isset($_GET['empty-cache'])) { - Tools::emptyCache(); - } elseif (isset($_GET['export'])) { - $this->wallabag->export(); - } elseif (isset($_GET['updatetheme'])) { - $this->wallabag->tpl->updateTheme($_POST['theme']); - } elseif (isset($_GET['updatelanguage'])) { - $this->wallabag->language->updateLanguage($_POST['language']); - } elseif (isset($_GET['uploadfile'])) { - $this->wallabag->uploadFile(); - } elseif (isset($_GET['feed'])) { - if (isset($_GET['action']) && $_GET['action'] == 'generate') { + // hello to you + $this->wallabag->login($this->referer); + } elseif (isset($_GET['feed']) && isset($_GET['user_id'])) { + $tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0); + $this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type']); + } + + //allowed ONLY to logged in user + if (\Session::isLogged() === true) + { + if (isset($_GET['logout'])) { + // see you soon ! + $this->wallabag->logout(); + } elseif (isset($_GET['config'])) { + // update password + $this->wallabag->updatePassword($_POST['password'], $_POST['password_repeat']); + } elseif (isset($_GET['newuser'])) { + $this->wallabag->createNewUser($_POST['newusername'], $_POST['password4newuser']); + } elseif (isset($_GET['deluser'])) { + $this->wallabag->deleteUser($_POST['password4deletinguser']); + } elseif (isset($_GET['epub'])) { + $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['id'], $_GET['value']); + $epub->run(); + } elseif (isset($_GET['import'])) { + $import = $this->wallabag->import(); + $tplVars = array_merge($this->vars, $import); + } elseif (isset($_GET['empty-cache'])) { + Tools::emptyCache(); + } elseif (isset($_GET['export'])) { + $this->wallabag->export(); + } elseif (isset($_GET['updatetheme'])) { + $this->wallabag->tpl->updateTheme($_POST['theme']); + } elseif (isset($_GET['updatelanguage'])) { + $this->wallabag->language->updateLanguage($_POST['language']); + } elseif (isset($_GET['uploadfile'])) { + $this->wallabag->uploadFile(); + } elseif (isset($_GET['feed']) && isset($_GET['action']) && $_GET['action'] == 'generate') { $this->wallabag->updateToken(); } - else { - $tag_id = (isset($_GET['tag_id']) ? intval($_GET['tag_id']) : 0); - $this->wallabag->generateFeeds($_GET['token'], filter_var($_GET['user_id'],FILTER_SANITIZE_NUMBER_INT), $tag_id, $_GET['type']); + elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { + $plainUrl = new Url(base64_encode($_GET['plainurl'])); + $this->wallabag->action('add', $plainUrl); } } - elseif (isset($_GET['plainurl']) && !empty($_GET['plainurl'])) { - $plainUrl = new Url(base64_encode($_GET['plainurl'])); - $this->wallabag->action('add', $plainUrl); - } } public function _render($file, $vars) -- cgit v1.2.3 From 6fc2c29daaadcd5075aec6bde2fd0f94274367a8 Mon Sep 17 00:00:00 2001 From: tcit Date: Sat, 27 Sep 2014 19:47:50 +0200 Subject: revert routing bad deleting --- inc/poche/Routing.class.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'inc/poche/Routing.class.php') diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index 0b373058..bd61a0b3 100755 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -119,8 +119,21 @@ class Routing } elseif (isset($_GET['deluser'])) { $this->wallabag->deleteUser($_POST['password4deletinguser']); } elseif (isset($_GET['epub'])) { - $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['id'], $_GET['value']); - $epub->run(); + $epub = new WallabagEpub($this->wallabag, $_GET['method'], $_GET['value']); + $epub->prepareData(); + $epub->produceEpub(); + } elseif (isset($_GET['mobi'])) { + $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); + $mobi->prepareData(); + $mobi->produceMobi(); + } elseif (isset($_GET['send2kindle'])) { + $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); + $mobi->prepareData(); + $mobi->produceMobi(TRUE); + } elseif (isset($_GET['pdf'])) { + $pdf = new WallabagPDF($this->wallabag, $_GET['method'], $_GET['value']); + $pdf->prepareData(); + $pdf->producePDF(); } elseif (isset($_GET['import'])) { $import = $this->wallabag->import(); $tplVars = array_merge($this->vars, $import); -- cgit v1.2.3 From 9f86454b48dec3c9ecfee8da224112eef0f61441 Mon Sep 17 00:00:00 2001 From: tcit Date: Sun, 28 Sep 2014 17:20:35 +0200 Subject: deleting send to kindle function --- inc/poche/Routing.class.php | 4 ---- 1 file changed, 4 deletions(-) (limited to 'inc/poche/Routing.class.php') diff --git a/inc/poche/Routing.class.php b/inc/poche/Routing.class.php index bd61a0b3..44b0e168 100755 --- a/inc/poche/Routing.class.php +++ b/inc/poche/Routing.class.php @@ -126,10 +126,6 @@ class Routing $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); $mobi->prepareData(); $mobi->produceMobi(); - } elseif (isset($_GET['send2kindle'])) { - $mobi = new WallabagMobi($this->wallabag, $_GET['method'], $_GET['value']); - $mobi->prepareData(); - $mobi->produceMobi(TRUE); } elseif (isset($_GET['pdf'])) { $pdf = new WallabagPDF($this->wallabag, $_GET['method'], $_GET['value']); $pdf->prepareData(); -- cgit v1.2.3