Fix libs Login, Basic and DB

- Login ads auto return error for AJAX based calls (so the script
doesn't loop hang)
- Basic gets remove line break call
- DB gets minor updates with arrays set and fixes in old internal method calls
This commit is contained in:
Clemens Schwaighofer
2018-11-28 15:28:27 +09:00
parent 9d918f3b43
commit 7e34c5321d
4 changed files with 80 additions and 56 deletions

View File

@@ -410,6 +410,7 @@ class ArrayIO extends \CoreLibs\DB\IO
}
$q_data .= $_value;
} elseif ($this->table_array[$column]['bool']) {
// boolean storeage (reverse check on ifset)
$q_data .= "'".$this->dbBoolean($this->table_array[$column]["value"], true)."'";
} elseif ($this->table_array[$column]["interval"]) {
// for interval we check if no value, then we set null

View File

@@ -124,7 +124,7 @@
* - closes db connection and writes error_msg to global error_msg
* db_cursor_pos($query)
* - returns the current position the db_return
* $array_of_hashes db_show_table_meta_Data($table_name)
* $array_of_hashes db_show_table_meta_data($table_name)
* - returns an hashed array of table column data
* function db_prepare($stm_name, $query)
* - prepares a query with the given stm name, returns false on error
@@ -317,11 +317,11 @@ class IO extends \CoreLibs\Basic
$this->db_user = $db_config['db_user'] ?? '';
$this->db_pwd = $db_config['db_pass'] ?? '';
$this->db_host = $db_config['db_host'] ?? '';
$this->db_port = array_key_exists('db_port', $db_config) ? $db_config['db_port'] : '5432';
$this->db_schema = array_key_exists('db_schema', $db_config) ? $db_config['db_schema'] : ''; // do not set to 'public' if not set, because the default is already public
$this->db_encoding = array_key_exists('db_encoding', $db_config) ? $db_config['db_encoding'] : '';
$this->db_port = !empty($db_config['db_port']) ? $db_config['db_port'] : '5432';
$this->db_schema = !empty($db_config['db_schema']) ? $db_config['db_schema'] : ''; // do not set to 'public' if not set, because the default is already public
$this->db_encoding = !empty($db_config['db_encoding']) ? $db_config['db_encoding'] : '';
$this->db_type = $db_config['db_type'] ?? '';
$this->db_ssl = array_key_exists('db_ssl', $db_config) ? $db_config['db_ssl'] : 'allow';
$this->db_ssl = !empty($db_config['db_ssl']) ? $db_config['db_ssl'] : 'allow';
// set the target encoding to the DEFAULT_ENCODING if it is one of them: EUC, Shift_JIS, UTF-8
// @ the moment set only from outside
@@ -938,7 +938,7 @@ class IO extends \CoreLibs\Basic
// DESC : returns the current set client encoding from the connected DB
public function dbGetEncoding()
{
return $this->db_return_row('SHOW client_encoding')['client_encoding'];
return $this->dbReturnRow('SHOW client_encoding')['client_encoding'];
}
// METHOD: dbInfo