Fix column named for edit_log to eu prefixed

as eucuid and eucuuid
This commit is contained in:
Clemens Schwaighofer
2024-12-13 11:37:11 +09:00
parent d16b920966
commit 1cf4fdf31a
3 changed files with 11 additions and 7 deletions

View File

@@ -1,7 +1,7 @@
-- 20241203: update edit tables
ALTER TABLE edit_generic ADD cuuid UUID DEFAULT gen_random_uuid();
ALTER TABLE edit_log ADD ecuid VARCHAR;
ALTER TABLE edit_log ADD ecuuid VARCHAR;
ALTER TABLE edit_log ADD eucuid VARCHAR;
ALTER TABLE edit_log ADD eucuuid VARCHAR;
ALTER TABLE edit_log ADD action_sub_id VARCHAR;
ALTER TABLE edit_log ADD http_data JSONB;
ALTER TABLE edit_log ADD ip_address JSONB;
@@ -32,3 +32,7 @@ BEGIN
END;
$$
LANGUAGE 'plpgsql';
--
ALTER TABLE edit_log RENAME ecuid TO eucuid;
ALTER TABLE edit_log RENAME ecuuid TO eucuuid;

View File

@@ -79,7 +79,7 @@ class Login
private ?int $edit_user_id;
/** @var ?string the user cuid (note will be super seeded with uuid v4 later) */
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;
/** @var string _GET/_POST loginUserId parameter for non password login */
private string $login_user_id = '';
@@ -2371,7 +2371,7 @@ HTML;
}
$q = <<<SQL
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,
http_host, http_data, session_id,
action_data
@@ -2727,7 +2727,7 @@ HTML;
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)
@@ -2938,7 +2938,7 @@ HTML;
if (empty($this->edit_user_cuuid)) {
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
if ($this->login_error == 103) {
return $this->permission_okay;

View File

@@ -358,7 +358,7 @@ class Backend
}
$q = <<<SQL
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,
http_accept, http_accept_charset, http_accept_encoding, session_id,
action, action_id, action_sub_id, action_yes, action_flag, action_menu, action_loaded,