]> git.nbdom.net Git - nb.git/commitdiff
bin/dbq.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 10 Dec 2022 00:18:24 +0000 (01:18 +0100)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Sat, 10 Dec 2022 00:18:24 +0000 (01:18 +0100)
bin/dbq.php [new file with mode: 0755]
etc/dbq/ldap.php
etc/vim/source/vars.vim
lib/php/db.php
lib/php/db/dbq.php [changed mode: 0644->0755]

diff --git a/bin/dbq.php b/bin/dbq.php
new file mode 100755 (executable)
index 0000000..353bbf0
--- /dev/null
@@ -0,0 +1,12 @@
+#!/usr/bin/env php
+<?php
+/**
+* @copyright (C) 2022 Nicolas Boisselier
+* @author Nicolas Boisselier nicolas.boisselier@gmail.com
+*
+* lib/php/db/dbq.php
+* Fix confusion between nb_api and bin/dbq
+* use instead directly what is used by nginx and do the query localy, otherwise just use curl
+*/
+require(realpath(dirname(__FILE__).'/../www/dbq/dbq.php'));
+?>
index a4444420b22ba195aaeae66e7deeece0927bbf39..a88309fd73105f264d34f8eb7174d1423ec61af6 100644 (file)
@@ -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 = '';
 
 }
index fff1677276feaab117c7151f31eac73dd03917f1..2ca66a6a7ce4eab6eab1a2acc7f4d8e2d5a78bc5 100644 (file)
@@ -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'
index 3ca7e4e68d2ba2fa2a440e09a735381a1717a503..4067bf92c8cfa3c2e093dbc844b84b463796e71d 100644 (file)
@@ -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;
old mode 100644 (file)
new mode 100755 (executable)
index 64753c7..d93f742
@@ -1,5 +1,5 @@
-<?php
 #!/usr/bin/env php
+<?php
 /**
 * @copyright (C) 2016 Nicolas Boisselier
 * @author Nicolas Boisselier nicolas.boisselier@gmail.com