From: Nicolas Boisselier Date: Sat, 10 Dec 2022 00:18:24 +0000 (+0100) Subject: bin/dbq.php X-Git-Url: https://git.nbdom.net/?a=commitdiff_plain;h=283b43f329c172b7b934d8a94b4af28ac6d53f3a;p=nb.git bin/dbq.php --- diff --git a/bin/dbq.php b/bin/dbq.php new file mode 100755 index 00000000..353bbf09 --- /dev/null +++ b/bin/dbq.php @@ -0,0 +1,12 @@ +#!/usr/bin/env php + diff --git a/etc/dbq/ldap.php b/etc/dbq/ldap.php index a4444420..a88309fd 100644 --- a/etc/dbq/ldap.php +++ b/etc/dbq/ldap.php @@ -8,6 +8,7 @@ if (isset($_SERVER['HTTP_HOST'])) { } else { $user = Nb::user_infos('name'); + return; # NB 09.12.22: Could not authenticate to LDAP server $password = ''; } diff --git a/etc/vim/source/vars.vim b/etc/vim/source/vars.vim index fff16772..2ca66a6a 100644 --- a/etc/vim/source/vars.vim +++ b/etc/vim/source/vars.vim @@ -4,7 +4,8 @@ " Command to check files per file types " " rows.fields=id,cmd_check -">SHELL_REPLACE nb_api '/nb/meta/ls/key,val.vim_hash?cat=file.check&preff=%09&name=mimeCheck' +" NB 10.12.22 ">ZSHELL_REPLACE nb_api '/nb/meta/ls/key,val.vim_hash?cat=file.check&preff=%09&name=mimeCheck' +">SHELL_REPLACE dbq.php nb meta ls key,val cat=file.check format=vim_hash preff=$'\t' name=mimeCheck let mimeCheck = { \ 'awk' : 'awk < /dev/null --lint=no-ext --file' \,'bash' : 'bash -c' diff --git a/lib/php/db.php b/lib/php/db.php index 3ca7e4e6..4067bf92 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -645,7 +645,8 @@ class Db extends nb { public function action($action,$table=null) { #debug(($this->tables)); - $actions = explode(',',$action); + # NB 09.12.22: Test is action is defined (eg: from lib/php/db/dbq/php) + $actions = $action ? explode(',',$action) : []; # NB 02.12.16 $this->pdef('format',($this->php_cli() ? 'csv' : '')); $rows = []; $return = false; diff --git a/lib/php/db/dbq.php b/lib/php/db/dbq.php old mode 100644 new mode 100755 index 64753c7d..d93f742a --- a/lib/php/db/dbq.php +++ b/lib/php/db/dbq.php @@ -1,5 +1,5 @@ -