From 402109f703a59a064231161db348ee6dddb22f1c Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Mon, 11 Dec 2017 19:14:38 +0000 Subject: [PATCH] bin/nb-update --- bin/nb-update | 1 + etc/profile.d/nb.sh | 4 ++-- lib/php/db/table.php | 2 +- www/dbq/dbq.php | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bin/nb-update b/bin/nb-update index faf7a4e5..cb8cc473 100755 --- a/bin/nb-update +++ b/bin/nb-update @@ -87,6 +87,7 @@ for repo in $(nb_repos); do fi echo + nb_host_info repo.$name $([ "$ex" = "0" ] && echo ok || echo "err=$ex" ) 1>/dev/null 2>&1 done diff --git a/etc/profile.d/nb.sh b/etc/profile.d/nb.sh index 60032b47..ab8c46e6 100644 --- a/etc/profile.d/nb.sh +++ b/etc/profile.d/nb.sh @@ -72,10 +72,10 @@ nb_perl() { ruby -r$NB_ROOT/lib/perl/NB -e "$@" } -nb_host_info_insert() { +nb_host_info() { local host=$(hostname) [ -z "$host" ] && host=$(hostname -f) local key="$1" local val="$2" - curl -sL -u nb:0TXARcQUpjHZctoROA2X.weWSZKM5DGT https://nbdom.net/host_info -d "host=$host" -d "key=$key" "val=$val" + curl -u nb:0TXARcQUpjHZctoROA2X.weWSZKM5DGT https://nbdom.net/host_info -H 'Accept: text/json' -d "host=$host" -d "key=$key" -d "val=$val" } diff --git a/lib/php/db/table.php b/lib/php/db/table.php index e3c0abe9..c6f453b5 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1766,7 +1766,7 @@ Class Table extends nb { } # NB 07.12.17: Add LIMIT 1. If a table as not primary key when want to delete only on record - $sql = 'DELETE FROM ' . $this->sql_name() . $where . " LIMIT 1"; + $sql = 'DELETE FROM ' . $this->sql_name() . $where . ($this->db()->type == 'pgsql' ? '' : ' LIMIT 1'); $info['sql'] = $sql; if (self::p('debug')) { diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index 0a7498dc..1da6588f 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -377,7 +377,8 @@ class DbQ extends nb { if ($this->perm < self::DELETE) return; if ($this->db->type == 'sqlite' and !is_writeable($this->db->host)) return; - $rm = $this->table->base.'/rm/'.$args; +# NB 11.12.17 $rm = $this->table->base.'/rm/'.$args; + $rm = $this->table->base.'/rm/'; $r['delete'] = '' .'
' .'Delete' -- 2.47.3