From 451f3ba6ea5a6079877ed37a7b915261e543b77a Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Sat, 2 Dec 2023 00:30:41 +0000 Subject: [PATCH] Fix bug /help --- www/dbq/dbq.php | 66 ++++++++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index c5df11a4..957c15b7 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -1235,34 +1235,44 @@ EOF; */ if ($action == 'help') { - $this->page($this->db,[ - [ 'help', 'This help' ], - [ 'ls', 'List configured databases' ], - # NB 14.12.22 [ 'databases', 'List others databases' ], - [ 'random_str', 'Generate a random string' ], - [ 'ssha_password', 'Encrypt a password' ], - [ 'ssha512_password', 'Encrypt a password' ], - [ 'logout', 'Clear Basic Auth' ], - [ 'status', 'Status infos page' ], - [ 'conf', 'Dump json infos' ], - [ 'types', 'Available mime types' ], - ] + ( - ($this->perm < self::ADMIN) ? [] : - [ -# NB 07.02.18 [ 'ldap', 'Connect to domain ldap server [/FILTER/ATTRS' ], - [ 'phpinfo', 'Phpinfo' ], - [ '_SERVER', 'Dump _SERVER' ], - [ '_REQUEST', 'Dump _REQUEST' ], - ] - ) - ,['command','description'],function(&$r) { - $r['command'] = $this->page->tag('a',$r['command'],'href="' - .$this->db->base.'/'.($r['command'] == self::PARAM_DB_DEFAULT - ? '' - : $r['command'] - ) - .'"'); - }); + $this->page($this->db + # Rows + ,array_merge( + [ + [ 'help', 'This help' ], + [ 'ls', 'List configured databases' ], + # NB 14.12.22 [ 'databases', 'List others databases' ], + [ 'random_str', 'Generate a random string' ], + [ 'ssha_password', 'Encrypt a password' ], + [ 'ssha512_password', 'Encrypt a password' ], + [ 'logout', 'Clear Basic Auth' ], + [ 'status', 'Status infos page' ], + [ 'conf', 'Dump api infos and params' ], + [ 'types', 'Available mime types' ], + ], + ( + ($this->perm < self::ADMIN) ? [] : + [ + # NB 07.02.18 [ 'ldap', 'Connect to domain ldap server [/FILTER/ATTRS' ], + [ 'phpinfo', 'Phpinfo' ], + [ '_SERVER', 'Dump _SERVER' ], + [ '_REQUEST', 'Dump _REQUEST' ], + ] + ) + ) + # Head + ,['command','description'] + # Print + ,function(&$r) { + $r['command'] = $this->page->tag('a',$r['command'], + 'href="'.$this->db->base.'/' + .($r['command'] == self::PARAM_DB_DEFAULT + ? '' + : $r['command'] + ) + .'"'); + }) + ; } elseif ($action == 'ls') { -- 2.47.3