Source
xxxxxxxxxx
zbx_db_result_t result = zbx_db_select("select saml_idp_entityid,saml_sso_url,saml_slo_url,saml_username_attribute,"
/*
** Zabbix
** Copyright (C) 2001-2023 Zabbix SIA
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
**/
/*
* 6.4 development database patches
*/
static int DBpatch_6030000(void)
{
zbx_db_result_t result;
zbx_db_row_t row;
zbx_db_insert_t db_insert;
int ret = SUCCEED;
if (0 == (DBget_program_type() & ZBX_PROGRAM_TYPE_SERVER))
return SUCCEED;
result = zbx_db_select("select roleid,type,name,value_int from role_rule where name in ("
"'ui.configuration.actions',"
"'ui.services.actions',"
"'ui.administration.general')");
zbx_db_insert_prepare(&db_insert, "role_rule", "role_ruleid", "roleid", "type", "name", "value_int",
(char *)NULL);
while (NULL != (row = zbx_db_fetch(result)))
{
zbx_uint64_t roleid;
int value_int, type;
ZBX_STR2UINT64(roleid, row[0]);
type = atoi(row[1]);
value_int = atoi(row[3]);
if (0 == strcmp(row[2], "ui.configuration.actions"))
{
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.configuration.autoregistration_actions", value_int);
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.configuration.discovery_actions", value_int);
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.configuration.internal_actions", value_int);
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.configuration.trigger_actions", value_int);
}
else if (0 == strcmp(row[2], "ui.administration.general"))
{
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.administration.housekeeping", value_int);
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.administration.macros", value_int);
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.administration.api_tokens", value_int);
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.administration.audit_log", value_int);
}
else
{
zbx_db_insert_add_values(&db_insert, __UINT64_C(0), roleid, type,
"ui.configuration.service_actions", value_int);
}
}