]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 14 Dec 2017 21:14:34 +0000 (21:14 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 14 Dec 2017 21:14:34 +0000 (21:14 +0000)
www/dbq/dbq.php

index 154fd488026c5071f476d5927234158bd18afaa7..d4fd5088f167fbcb19d36c1c8189fe10b5f2baf0 100644 (file)
@@ -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`");
 
                }