From 6c194aeee01d91d94e755afa9280ccc5ef6324b6 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Tue, 10 Jul 2018 11:29:26 +0100 Subject: [PATCH] lib/postgres/article.sql --- lib/postgres/article.sql | 2 +- lib/postgres/website.sql | 21 +++++++++++---------- www/dbq/dbq.php | 11 ++++++++++- 3 files changed, 22 insertions(+), 12 deletions(-) diff --git a/lib/postgres/article.sql b/lib/postgres/article.sql index 59daf3f5..abefe059 100644 --- a/lib/postgres/article.sql +++ b/lib/postgres/article.sql @@ -10,7 +10,7 @@ CREATE TABLE IF NOT EXISTS article ( CREATE TEMPORARY TABLE _article AS SELECT * FROM article LIMIT 0; BEGIN TRANSACTION; DELETE FROM _article; -COPY _article FROM PROGRAM '. /etc/profile && psql data -Atc "select rss from website" \ +COPY _article FROM PROGRAM '. /etc/profile && psql data -Atc "select rss from website where rss_on" \ | xargs -n 1 rss-feedparser | sed "s/\$/\tf/" ' WITH (format 'text', NULL ''); INSERT INTO article SELECT * FROM _article ON CONFLICT (url) DO NOTHING; diff --git a/lib/postgres/website.sql b/lib/postgres/website.sql index 92cbeb4a..d50e6c53 100644 --- a/lib/postgres/website.sql +++ b/lib/postgres/website.sql @@ -7,19 +7,20 @@ CREATE TABLE IF NOT EXISTS website ( name varchar(200), description varchar(500), --url varchar(200), - rss varchar(300) + rss varchar(300), + rss_on boolean DEFAULT 't' ); BEGIN TRANSACTION; DELETE FROM website; COPY website FROM STDIN WITH (format 'text', NULL ''); -https://www.corbettreport.com eng The Corbett Report Open Source Intelligence News https://feeds.feedburner.com/CorbettReportRSS -https://wearechange.or/ eng We Are Change Be the Change You Wish to See in the World https://feeds.feedburner.com/wrc -https://www.egaliteetreconciliation.fr fra Egalite et Réconciliation Gauche du travail, Droite des valeurs : pour une réconciliation nationale ! https://www.egaliteetreconciliation.fr/spip.php?page=backend -https://www.infowars.com eng INFOWARS Alex Jones' Infowars: There's a war on for your mind! https://www.infowars.com/feed/custom_feed_rss -https://www.tvlibertes.com fra TVL TVLibertés - 1ère chaîne de réinformation. Nous, c'est vous https://www.tvlibertes.com/feed -https://www.rt.com eng RT International RT is the first Russian 24/7 English-language news channel which brings the Russian view on global news. https://www.rt.com/rss -https://pressfortruth.ca eng Press For Truth Press For Truth is a team of videographers, investigative journalists and political activists. We do our best to expose the global elite and their plans for a new world order. https://pressfortruth.ca/index.php/tools/blocks/problog_list/rss?cID=147 -https://www.youtube.com/channel/UC2aQGaCZjQC1lM3DOwbCIFw eng The Truth Factory The Truth Factory https://www.youtube.com/feeds/videos.xml?channel_id=UC2aQGaCZjQC1lM3DOwbCIFw +https://www.corbettreport.com eng The Corbett Report Open Source Intelligence News https://feeds.feedburner.com/CorbettReportRSS t +https://wearechange.or/ eng We Are Change Be the Change You Wish to See in the World https://feeds.feedburner.com/wrc t +https://www.egaliteetreconciliation.fr fra Egalite et Réconciliation Gauche du travail, Droite des valeurs : pour une réconciliation nationale ! https://www.egaliteetreconciliation.fr/spip.php?page=backend t +https://www.infowars.com eng INFOWARS Alex Jones' Infowars: There's a war on for your mind! https://www.infowars.com/feed/custom_feed_rss t +https://www.tvlibertes.com fra TVL TVLibertés - 1ère chaîne de réinformation. Nous, c'est vous https://www.tvlibertes.com/feed t +https://www.rt.com eng RT International RT is the first Russian 24/7 English-language news channel which brings the Russian view on global news. https://www.rt.com/rss t +https://pressfortruth.ca eng Press For Truth Press For Truth is a team of videographers, investigative journalists and political activists. We do our best to expose the global elite and their plans for a new world order. https://pressfortruth.ca/index.php/tools/blocks/problog_list/rss?cID=147 t +https://www.youtube.com/channel/UC2aQGaCZjQC1lM3DOwbCIFw eng The Truth Factory The Truth Factory https://www.youtube.com/feeds/videos.xml?channel_id=UC2aQGaCZjQC1lM3DOwbCIFw t \. --- 5|eng|Youtube INFO WARS NEWS||https://www.youtube.com/channel/UCUIjs9R044OjAxKzk0xhGoQ|https://www.youtube.com/feeds/videos.xml?channel_id=UCUIjs9R044OjAxKzk0xhGoQ +-- 5|eng|Youtube INFO WARS NEWS||https://www.youtube.com/channel/UCUIjs9R044OjAxKzk0xhGoQ|https://www.youtube.com/feeds/videos.xml?channel_id=UCUIjs9R044OjAxKzk0xhGoQ t COMMIT; diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index afb14860..cd5ba423 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -447,6 +447,14 @@ class DbQ extends nb { $keys = array_keys($keys); $values = ($_SERVER['REQUEST_METHOD'] == 'POST') ? $_POST : explode($this->param_args_sep,$this->params['args']); + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + $values = $_POST; + } elseif($this->params['args']) { + $values = explode($this->param_args_sep,$this->params['args']); + } else { + $values = $_GET; + } + foreach ($values as $k=>$v) { if (!in_array($k,$keys)) unset($values[$k]); } @@ -1352,7 +1360,7 @@ EOF; } elseif ($action == 'rm') { $this->deniedUnless($this->perm >= self::DELETE); - if (!$this->table->delete($_POST,$info)) $this->error('rm: '.print_r($info,true)); + if (!$this->table->delete(empty($_POST) ? $_GET : $_POST,$info)) $this->error('rm: '.print_r($info,true)); $this->redirect_if_no_referer($this->table->base.'/'); $this->page($info); @@ -1368,6 +1376,7 @@ EOF; } public function redirect_if_no_referer($url) { + if (!empty($_SERVER['HTTP_REFERER'])) $url = $_SERVER['HTTP_REFERER']; if ($this->p('referer')) $url = urldecode($this->p('referer')); header('Location: '.$url); } -- 2.47.3