Compare commits
8 Commits
e349613d60
...
v9.24.1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4971f62490 | ||
|
|
1cf4fdf31a | ||
|
|
d16b920966 | ||
|
|
ab52bf59b5 | ||
|
|
a8dd076aac | ||
|
|
c17ca1f847 | ||
|
|
c13934de99 | ||
|
|
fdefaca301 |
@@ -10,8 +10,8 @@ CREATE TABLE edit_log (
|
|||||||
edit_log_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
edit_log_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||||
euid INT, -- this is a foreign key, but I don't nedd to reference to it
|
euid INT, -- this is a foreign key, but I don't nedd to reference to it
|
||||||
FOREIGN KEY (euid) REFERENCES edit_user (edit_user_id) MATCH FULL ON UPDATE CASCADE ON DELETE SET NULL,
|
FOREIGN KEY (euid) REFERENCES edit_user (edit_user_id) MATCH FULL ON UPDATE CASCADE ON DELETE SET NULL,
|
||||||
ecuid VARCHAR,
|
eucuid VARCHAR,
|
||||||
ecuuid UUID, -- this is the one we want to use, full UUIDv4 from the edit user table
|
eucuuid UUID, -- this is the one we want to use, full UUIDv4 from the edit user table
|
||||||
-- date_created equal, but can be overridden
|
-- date_created equal, but can be overridden
|
||||||
event_date TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
event_date TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||||
-- session ID if set
|
-- session ID if set
|
||||||
|
|||||||
@@ -652,8 +652,8 @@ CREATE TABLE edit_log (
|
|||||||
edit_log_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
edit_log_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||||
euid INT, -- this is a foreign key, but I don't nedd to reference to it
|
euid INT, -- this is a foreign key, but I don't nedd to reference to it
|
||||||
FOREIGN KEY (euid) REFERENCES edit_user (edit_user_id) MATCH FULL ON UPDATE CASCADE ON DELETE SET NULL,
|
FOREIGN KEY (euid) REFERENCES edit_user (edit_user_id) MATCH FULL ON UPDATE CASCADE ON DELETE SET NULL,
|
||||||
ecuid VARCHAR,
|
eucuid VARCHAR,
|
||||||
ecuuid UUID, -- this is the one we want to use, full UUIDv4 from the edit user table
|
eucuuid UUID, -- this is the one we want to use, full UUIDv4 from the edit user table
|
||||||
-- date_created equal, but can be overridden
|
-- date_created equal, but can be overridden
|
||||||
event_date TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
event_date TIMESTAMP WITHOUT TIME ZONE DEFAULT CURRENT_TIMESTAMP,
|
||||||
-- session ID if set
|
-- session ID if set
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
-- 20241203: update edit tables
|
-- 20241203: update edit tables
|
||||||
ALTER TABLE edit_generic ADD cuuid UUID DEFAULT gen_random_uuid();
|
ALTER TABLE edit_generic ADD cuuid UUID DEFAULT gen_random_uuid();
|
||||||
ALTER TABLE edit_log ADD ecuid VARCHAR;
|
ALTER TABLE edit_log ADD eucuid VARCHAR;
|
||||||
ALTER TABLE edit_log ADD ecuuid VARCHAR;
|
ALTER TABLE edit_log ADD eucuuid VARCHAR;
|
||||||
ALTER TABLE edit_log ADD action_sub_id VARCHAR;
|
ALTER TABLE edit_log ADD action_sub_id VARCHAR;
|
||||||
ALTER TABLE edit_log ADD http_data JSONB;
|
ALTER TABLE edit_log ADD http_data JSONB;
|
||||||
ALTER TABLE edit_log ADD ip_address JSONB;
|
ALTER TABLE edit_log ADD ip_address JSONB;
|
||||||
@@ -32,3 +32,7 @@ BEGIN
|
|||||||
END;
|
END;
|
||||||
$$
|
$$
|
||||||
LANGUAGE 'plpgsql';
|
LANGUAGE 'plpgsql';
|
||||||
|
|
||||||
|
--
|
||||||
|
ALTER TABLE edit_log RENAME ecuid TO eucuid;
|
||||||
|
ALTER TABLE edit_log RENAME ecuuid TO eucuuid;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ require 'config.php';
|
|||||||
$LOG_FILE_ID = 'classTest-convert-colors';
|
$LOG_FILE_ID = 'classTest-convert-colors';
|
||||||
ob_end_flush();
|
ob_end_flush();
|
||||||
|
|
||||||
use CoreLibs\Convert\Colors;
|
// use CoreLibs\Convert\Colors;
|
||||||
use CoreLibs\Convert\Color\Color;
|
use CoreLibs\Convert\Color\Color;
|
||||||
use CoreLibs\Convert\Color\Coordinates;
|
use CoreLibs\Convert\Color\Coordinates;
|
||||||
use CoreLibs\Debug\Support as DgS;
|
use CoreLibs\Debug\Support as DgS;
|
||||||
@@ -29,7 +29,6 @@ $log = new CoreLibs\Logging\Logging([
|
|||||||
'log_file_id' => $LOG_FILE_ID,
|
'log_file_id' => $LOG_FILE_ID,
|
||||||
'log_per_date' => true,
|
'log_per_date' => true,
|
||||||
]);
|
]);
|
||||||
$color_class = 'CoreLibs\Convert\Colors';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* print out a color block with info
|
* print out a color block with info
|
||||||
|
|||||||
@@ -34,18 +34,18 @@ use CoreLibs\Debug\Support;
|
|||||||
echo "<br><b>LIST LOCALES</b><br>";
|
echo "<br><b>LIST LOCALES</b><br>";
|
||||||
|
|
||||||
$locale = 'en_US.UTF-8';
|
$locale = 'en_US.UTF-8';
|
||||||
$locales = L10n::listLocales($locale);
|
$locales = Language\L10n::listLocales($locale);
|
||||||
print "[" . $locale . "] LOCALES: " . Support::printAr($locales) . "<br>";
|
print "[" . $locale . "] LOCALES: " . Support::printAr($locales) . "<br>";
|
||||||
$locale = 'en.UTF-8';
|
$locale = 'en.UTF-8';
|
||||||
$locales = L10n::listLocales($locale);
|
$locales = Language\L10n::listLocales($locale);
|
||||||
print "[" . $locale . "] LOCALES: " . Support::printAr($locales) . "<br>";
|
print "[" . $locale . "] LOCALES: " . Support::printAr($locales) . "<br>";
|
||||||
|
|
||||||
echo "<br><b>PARSE LOCAL</b><br>";
|
echo "<br><b>PARSE LOCAL</b><br>";
|
||||||
$locale = 'en_US.UTF-8';
|
$locale = 'en_US.UTF-8';
|
||||||
$locale_info = L10n::parseLocale($locale);
|
$locale_info = Language\L10n::parseLocale($locale);
|
||||||
print "[" . $locale . "] INFO: " . Support::printAr($locale_info) . "<br>";
|
print "[" . $locale . "] INFO: " . Support::printAr($locale_info) . "<br>";
|
||||||
$locale = 'en.UTF-8';
|
$locale = 'en.UTF-8';
|
||||||
$locale_info = L10n::parseLocale($locale);
|
$locale_info = Language\L10n::parseLocale($locale);
|
||||||
print "[" . $locale . "] INFO: " . Support::printAr($locale_info) . "<br>";
|
print "[" . $locale . "] INFO: " . Support::printAr($locale_info) . "<br>";
|
||||||
|
|
||||||
/* echo "<br><b>AUTO DETECT</b><br>";
|
/* echo "<br><b>AUTO DETECT</b><br>";
|
||||||
|
|||||||
@@ -79,7 +79,7 @@ class Login
|
|||||||
private ?int $edit_user_id;
|
private ?int $edit_user_id;
|
||||||
/** @var ?string the user cuid (note will be super seeded with uuid v4 later) */
|
/** @var ?string the user cuid (note will be super seeded with uuid v4 later) */
|
||||||
private ?string $edit_user_cuid;
|
private ?string $edit_user_cuid;
|
||||||
/** @var ?string UUIDv4, will superseed the ecuid and replace euid as login id */
|
/** @var ?string UUIDv4, will superseed the eucuid and replace euid as login id */
|
||||||
private ?string $edit_user_cuuid;
|
private ?string $edit_user_cuuid;
|
||||||
/** @var string _GET/_POST loginUserId parameter for non password login */
|
/** @var string _GET/_POST loginUserId parameter for non password login */
|
||||||
private string $login_user_id = '';
|
private string $login_user_id = '';
|
||||||
@@ -2371,7 +2371,7 @@ HTML;
|
|||||||
}
|
}
|
||||||
$q = <<<SQL
|
$q = <<<SQL
|
||||||
INSERT INTO {DB_SCHEMA}.edit_log (
|
INSERT INTO {DB_SCHEMA}.edit_log (
|
||||||
username, euid, ecuid, ecuuid, event_date, event, error, data, data_binary, page,
|
username, euid, eucuid, eucuuid, event_date, event, error, data, data_binary, page,
|
||||||
ip, ip_address, user_agent, referer, script_name, query_string, request_scheme, server_name,
|
ip, ip_address, user_agent, referer, script_name, query_string, request_scheme, server_name,
|
||||||
http_host, http_data, session_id,
|
http_host, http_data, session_id,
|
||||||
action_data
|
action_data
|
||||||
@@ -2727,7 +2727,7 @@ HTML;
|
|||||||
return $this->session->get('LOGIN_PAGES');
|
return $this->session->get('LOGIN_PAGES');
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: logged in uid(pk)/cuid/ecuuid
|
// MARK: logged in uid(pk)/eucuid/eucuuid
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the current set EUID (edit user id)
|
* Get the current set EUID (edit user id)
|
||||||
@@ -2938,7 +2938,7 @@ HTML;
|
|||||||
if (empty($this->edit_user_cuuid)) {
|
if (empty($this->edit_user_cuuid)) {
|
||||||
return $this->permission_okay;
|
return $this->permission_okay;
|
||||||
}
|
}
|
||||||
// euid must match ecuid and ecuuid
|
// euid must match eucuid and eucuuid
|
||||||
// bail for previous wrong page match, eg if method is called twice
|
// bail for previous wrong page match, eg if method is called twice
|
||||||
if ($this->login_error == 103) {
|
if ($this->login_error == 103) {
|
||||||
return $this->permission_okay;
|
return $this->permission_okay;
|
||||||
|
|||||||
@@ -358,7 +358,7 @@ class Backend
|
|||||||
}
|
}
|
||||||
$q = <<<SQL
|
$q = <<<SQL
|
||||||
INSERT INTO {DB_SCHEMA}.edit_log (
|
INSERT INTO {DB_SCHEMA}.edit_log (
|
||||||
username, euid, ecuid, ecuuid, event_date, event, error, data, data_binary, page,
|
username, euid, eucuid, eucuuid, event_date, event, error, data, data_binary, page,
|
||||||
ip, user_agent, referer, script_name, query_string, server_name, http_host,
|
ip, user_agent, referer, script_name, query_string, server_name, http_host,
|
||||||
http_accept, http_accept_charset, http_accept_encoding, session_id,
|
http_accept, http_accept_charset, http_accept_encoding, session_id,
|
||||||
action, action_id, action_sub_id, action_yes, action_flag, action_menu, action_loaded,
|
action, action_id, action_sub_id, action_yes, action_flag, action_menu, action_loaded,
|
||||||
|
|||||||
@@ -527,7 +527,9 @@ class ArrayHandler
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* From the array with key -> anything values return only the matching entries from key list
|
* From the array with key -> mixed values,
|
||||||
|
* return only the entries where the key matches the key given in the key list parameter
|
||||||
|
*
|
||||||
* key list is a list[string]
|
* key list is a list[string]
|
||||||
* if key list is empty, return array as is
|
* if key list is empty, return array as is
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user