From 72cd85788b9b4abc14d8ae742021ac08a823ed55 Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Thu, 14 Dec 2017 21:14:34 +0000 Subject: [PATCH] www/dbq/dbq.php --- www/dbq/dbq.php | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 154fd488..d4fd5088 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -167,7 +167,7 @@ class DbQ extends nb { $filter = ($this->params['table'] ? $this->params['table'] : ''); $attrs = ($this->params['action'] ? explode(',',$this->params['action']) : []); - if (!strpos($this->params['table'],'=')) { + if (!empty($this->params['table']) and !strpos($this->params['table'],'=')) { $filter = ''; $attrs = explode(',',$this->params['table']); } @@ -187,9 +187,9 @@ class DbQ extends nb { $this->page($rows); } - public function page_ls($args) { + public function page_table_ls($args) { $this->deniedUnless($this->perm >= self::READ); - if (!strpos($args,'=')) $this->table->fields_only = explode(',',$args); + if (!empty($args) and !strpos($args,'=')) $this->table->fields_only = explode(',',$args); $this->page($this,'table_rows'); } @@ -769,10 +769,7 @@ EOF; 'name' => 'dbq.params.format', 'value' => $this->params['format'], ]; - if (0) $rows[] = [ - 'name' => 'dbq.page.is.html', - 'value' => ($this->page->is('html') ? 1 : 0), - ]; + $user = ''; if (true or $user = $this->logged()) { if ($user) $rows[] = [ 'name' => 'dbq.user.name', 'value' => $user ]; @@ -1142,7 +1139,7 @@ EOF; }); } elseif ($action == 'ls') { - $this->page_ls($this->params['args']); + $this->page_table_ls($this->params['args']); } elseif ($action == 'fields') { $this->page($this->table,'fields_rows'); @@ -1184,7 +1181,7 @@ EOF; } else { - if (!strpos($action,'=')) $this->page_ls($action); + if (!strpos($action,'=')) $this->page_table_ls($action); $this->notImplemented('Unknown table action'." `$action`"); } -- 2.47.3