From df46b0482a3095b5dc8483f8b4c0534fbce3b742 Mon Sep 17 00:00:00 2001 From: Devops Date: Tue, 4 Apr 2017 11:38:59 +0100 Subject: [PATCH] lib/php/db/table.php --- lib/php/db.php | 7 ++++--- lib/php/db/field.php | 2 +- lib/php/db/table.php | 7 ++++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/lib/php/db.php b/lib/php/db.php index f18e8ce8..e1ca169d 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -146,7 +146,9 @@ class Db extends nb { # Tables if (isset($opt['tables'])) { - foreach ($opt['tables'] as $name=>$param) $this->table($name,$param); + foreach ($opt['tables'] as $name=>$param) { + $this->table($name,$param); + } unset($opt['tables']); } @@ -1249,7 +1251,6 @@ class Db extends nb { $type = self::p('type',''); foreach ($this->conf as $id => $attr) { -# NB 21.09.16 $attr['_no_connect'] = true; $attr['id'] = $id; $d = new Db($attr); $db = []; @@ -1270,7 +1271,7 @@ class Db extends nb { public function table_row_encrypt(&$table,&$row) { if (!empty($table->update_parse)) { $fct = $table->update_parse; - $row = $fct($row,$table); + $fct($row,$table); } if (0 diff --git a/lib/php/db/field.php b/lib/php/db/field.php index 04e4b496..ba02cbf9 100644 --- a/lib/php/db/field.php +++ b/lib/php/db/field.php @@ -60,7 +60,7 @@ class field extends nb { public function html_type() { # See: http://www.w3schools.com/html/html_form_input_types.asp - if (strpos($this->name,'password') !== false) return 'password'; + if (strpos($this->name,'password') !== false) return 'password" autocomplete="off'; if ($this->numeric() !== false) return 'number" step="any'; return 'text'; # Html5 only diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 08b1b1c7..71a0065f 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1613,10 +1613,11 @@ Class Table extends nb { $this->err_sql($sql); return false; } - foreach ($fields as $name => $field) { $row = [ $name => $post[$name] ]; $this->db()->table_row_encrypt($this,$row); + #debug($name.': '.$row[$name]); + if (!empty($info['values'][$name])) $info['values'][$name] = $row[$name]; $field->bindParam($query,$row[$name],":$name"); } @@ -2207,8 +2208,8 @@ Class Table extends nb { #return $ex; } - public function ssha_password($password='') { - return $this->db->ssha_password($password); + public function ssha_password($password) { + return $this->db()->ssha_password($password); } } # < Class __table_define(); -- 2.47.3