mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-29 16:55:05 +02:00
Added support for policies tags into the function 'tags_get_module_tags'. INCIDENT: #1644
This commit is contained in:
parent
b856056f55
commit
b7a75ea501
@ -461,7 +461,8 @@ function tags_insert_policy_module_tag ($id_agent_module, $tags) {
|
|||||||
|
|
||||||
$values['id_tag'] = $tag;
|
$values['id_tag'] = $tag;
|
||||||
$values['id_policy_module'] = $id_agent_module;
|
$values['id_policy_module'] = $id_agent_module;
|
||||||
$result_tag = db_process_sql_insert('ttag_policy_module', $values, false);
|
$result_tag = db_process_sql_insert('ttag_policy_module',
|
||||||
|
$values, false);
|
||||||
if ($result_tag === false)
|
if ($result_tag === false)
|
||||||
$errn++;
|
$errn++;
|
||||||
}
|
}
|
||||||
@ -556,12 +557,20 @@ function tags_update_policy_module_tag ($id_policy_module, $tags, $autocommit =
|
|||||||
*
|
*
|
||||||
* @return mixed Array with module tags or false if something goes wrong.
|
* @return mixed Array with module tags or false if something goes wrong.
|
||||||
*/
|
*/
|
||||||
function tags_get_module_tags ($id_agent_module) {
|
function tags_get_module_tags ($id, $policy = false) {
|
||||||
if (empty($id_agent_module))
|
if (empty($id))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
$tags = db_get_all_rows_filter('ttag_module',
|
html_debug_print(func_get_args());
|
||||||
array('id_agente_modulo' => $id_agent_module), false);
|
|
||||||
|
if ($policy) {
|
||||||
|
$tags = db_get_all_rows_filter('ttag_policy_module',
|
||||||
|
array('id_policy_module' => $id), false);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$tags = db_get_all_rows_filter('ttag_module',
|
||||||
|
array('id_agente_modulo' => $id), false);
|
||||||
|
}
|
||||||
|
|
||||||
if ($tags === false)
|
if ($tags === false)
|
||||||
return array();
|
return array();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user