From 6dc2f14562d92a6f0832ded1d46c3b13b477ed5c Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 13 Oct 2017 15:42:45 +0100 Subject: [PATCH] www/dbq/dbq.php --- www/dbq/dbq.php | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 00cf269e..629c9f0a 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -802,10 +802,10 @@ EOF; [ 'ssha512_password', 'Encrypt a password' ], [ 'logout', 'Clear Basic Auth' ], [ 'status', 'Status infos page' ], + [ 'json', 'Dump json infos' ], ] + ( ($this->perm < self::ADMIN) ? [] : [ - [ 'json', 'Dump json infos' ], [ 'phpinfo', 'Phpinfo datas' ], [ '_SERVER', 'Dumper _SERVER' ], [ '_REQUEST', 'Dumper _REQUEST' ], @@ -847,12 +847,12 @@ EOF; } elseif ($action == 'status') { $this->page($this,'status'); - } elseif ($this->perm < self::ADMIN) { - // NOW ONLY FOR ADMIN ! - } elseif ($action == 'json') { $this->page($this,'json'); + } elseif ($this->perm < self::ADMIN) { + // NOW ONLY FOR ADMIN ! + } elseif ($action == 'phpinfo') { $this->rows_table($action,$this->phpinfo_rows()); #$this->page(['phpinfo'=>$this->page->phpinfo(true)]); @@ -888,6 +888,10 @@ EOF; [ 'help', 'This help' ], [ 'status', 'Database status' ], [ 'ls', 'List tables' ], + [ 'databases', 'List databases' ], + [ 'schema', 'Dump database structure only' ], + [ 'dump', 'Dump database structure with datas' ], + [ 'csv', 'Dump database data in csv with table name as first colum' ], ],['command','description'],function(&$r){ $r['command'] = $this->page->tag('a',$r['command'],'href="' .$this->db->base.'/'.($r['command'] == self::PARAM_DB_DEFAULT @@ -920,7 +924,7 @@ EOF; $this->db->dump2csv(); exit; - } elseif ($action == 'sql') { + } elseif ($action == 'schema') { header('Content-type: text/plain'); $this->db->sql(); exit; -- 2.47.3