Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e34c5321d |
@@ -845,6 +845,20 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
private function loginPrintLogin()
|
private function loginPrintLogin()
|
||||||
{
|
{
|
||||||
if (!$this->permission_okay) {
|
if (!$this->permission_okay) {
|
||||||
|
// get global AJAX page trigger
|
||||||
|
// if true, return error ajax
|
||||||
|
global $AJAX_PAGE;
|
||||||
|
if ($AJAX_PAGE === true) {
|
||||||
|
$data = array (
|
||||||
|
'status' => 'error',
|
||||||
|
'error_code' => $this->loging_error,
|
||||||
|
'msg' => array (
|
||||||
|
'level' => 'error',
|
||||||
|
'str' => $this->l->__('Login necessary')
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$html_string = json_encode($data);
|
||||||
|
} else {
|
||||||
// set the templates now
|
// set the templates now
|
||||||
$this->loginSetTemplates();
|
$this->loginSetTemplates();
|
||||||
// if there is a global logout target ...
|
// if there is a global logout target ...
|
||||||
@@ -901,7 +915,7 @@ class Login extends \CoreLibs\DB\IO
|
|||||||
foreach ($this->login_template['strings'] as $string => $data) {
|
foreach ($this->login_template['strings'] as $string => $data) {
|
||||||
$html_string = str_replace('{'.$string.'}', $data, $html_string);
|
$html_string = str_replace('{'.$string.'}', $data, $html_string);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
// return the created HTML here
|
// return the created HTML here
|
||||||
return $html_string;
|
return $html_string;
|
||||||
} // if permission is 0 then print out login
|
} // if permission is 0 then print out login
|
||||||
|
|||||||
@@ -1238,7 +1238,7 @@ class Basic
|
|||||||
// DESC : calculates the bytes based on a string with nnG, nnM, etc
|
// DESC : calculates the bytes based on a string with nnG, nnM, etc
|
||||||
public static function stringByteFormat($number)
|
public static function stringByteFormat($number)
|
||||||
{
|
{
|
||||||
$number = trim($number);
|
$number = (int)trim($number);
|
||||||
$last = strtolower($number[strlen($number) - 1]);
|
$last = strtolower($number[strlen($number) - 1]);
|
||||||
switch ($last) {
|
switch ($last) {
|
||||||
case 't':
|
case 't':
|
||||||
@@ -2266,6 +2266,15 @@ class Basic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// METHOD: removeLB
|
||||||
|
// PARAMS: string, optional replace character
|
||||||
|
// RETURN: string with line breaks removed
|
||||||
|
// DESC : strips out all line breaks or replaced with given string
|
||||||
|
public function removeLB($string, $replace = ' ')
|
||||||
|
{
|
||||||
|
return str_replace(array("\r", "\n"), $replace, $string);
|
||||||
|
}
|
||||||
|
|
||||||
// METHOD: setFormToken
|
// METHOD: setFormToken
|
||||||
// PARAMS: session name, if not set then default is form_token
|
// PARAMS: session name, if not set then default is form_token
|
||||||
// RETURN: form token
|
// RETURN: form token
|
||||||
|
|||||||
@@ -410,6 +410,7 @@ class ArrayIO extends \CoreLibs\DB\IO
|
|||||||
}
|
}
|
||||||
$q_data .= $_value;
|
$q_data .= $_value;
|
||||||
} elseif ($this->table_array[$column]['bool']) {
|
} elseif ($this->table_array[$column]['bool']) {
|
||||||
|
// boolean storeage (reverse check on ifset)
|
||||||
$q_data .= "'".$this->dbBoolean($this->table_array[$column]["value"], true)."'";
|
$q_data .= "'".$this->dbBoolean($this->table_array[$column]["value"], true)."'";
|
||||||
} elseif ($this->table_array[$column]["interval"]) {
|
} elseif ($this->table_array[$column]["interval"]) {
|
||||||
// for interval we check if no value, then we set null
|
// for interval we check if no value, then we set null
|
||||||
|
|||||||
@@ -124,7 +124,7 @@
|
|||||||
* - closes db connection and writes error_msg to global error_msg
|
* - closes db connection and writes error_msg to global error_msg
|
||||||
* db_cursor_pos($query)
|
* db_cursor_pos($query)
|
||||||
* - returns the current position the db_return
|
* - 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
|
* - returns an hashed array of table column data
|
||||||
* function db_prepare($stm_name, $query)
|
* function db_prepare($stm_name, $query)
|
||||||
* - prepares a query with the given stm name, returns false on error
|
* - 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_user = $db_config['db_user'] ?? '';
|
||||||
$this->db_pwd = $db_config['db_pass'] ?? '';
|
$this->db_pwd = $db_config['db_pass'] ?? '';
|
||||||
$this->db_host = $db_config['db_host'] ?? '';
|
$this->db_host = $db_config['db_host'] ?? '';
|
||||||
$this->db_port = array_key_exists('db_port', $db_config) ? $db_config['db_port'] : '5432';
|
$this->db_port = !empty($db_config['db_port']) ? $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_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 = array_key_exists('db_encoding', $db_config) ? $db_config['db_encoding'] : '';
|
$this->db_encoding = !empty($db_config['db_encoding']) ? $db_config['db_encoding'] : '';
|
||||||
$this->db_type = $db_config['db_type'] ?? '';
|
$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
|
// 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
|
// @ 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
|
// DESC : returns the current set client encoding from the connected DB
|
||||||
public function dbGetEncoding()
|
public function dbGetEncoding()
|
||||||
{
|
{
|
||||||
return $this->db_return_row('SHOW client_encoding')['client_encoding'];
|
return $this->dbReturnRow('SHOW client_encoding')['client_encoding'];
|
||||||
}
|
}
|
||||||
|
|
||||||
// METHOD: dbInfo
|
// METHOD: dbInfo
|
||||||
|
|||||||
Reference in New Issue
Block a user