2011-02-15 Miguel de Dios <miguel.dedios@artica.es>
* include/functions_alerts.php, operation/agentes/estado_agente.php: added check ACL in the show actions in the creation and edit of alerts. Fixes: #3166657 git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3853 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
ef8e0c78b5
commit
98398faa0b
|
@ -1,3 +1,10 @@
|
||||||
|
2011-02-15 Miguel de Dios <miguel.dedios@artica.es>
|
||||||
|
|
||||||
|
* include/functions_alerts.php, operation/agentes/estado_agente.php: added
|
||||||
|
check ACL in the show actions in the creation and edit of alerts.
|
||||||
|
|
||||||
|
Fixes: #3166657
|
||||||
|
|
||||||
2011-02-15 Javier Lanz <javier.lanz@argica.es>
|
2011-02-15 Javier Lanz <javier.lanz@argica.es>
|
||||||
* godmode/groups/group_list.php: Fixed ACL checkings
|
* godmode/groups/group_list.php: Fixed ACL checkings
|
||||||
|
|
||||||
|
|
|
@ -204,8 +204,23 @@ function clone_alert_action ($id_alert_action) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function get_alert_actions ($only_names = true) {
|
/**
|
||||||
$all_actions = get_db_all_rows_in_table ('talert_actions');
|
* Get all alert actions in Pandora DB.
|
||||||
|
*
|
||||||
|
* @param bool $only_names Return only names, by default is true.
|
||||||
|
* @param bool $acl Check the ACL, by default is false
|
||||||
|
*
|
||||||
|
* @return array The list of actions.
|
||||||
|
*/
|
||||||
|
function get_alert_actions ($only_names = true, $acl = false) {
|
||||||
|
$groups = get_user_groups(false, "AR", true);
|
||||||
|
|
||||||
|
if ($groups === false) {
|
||||||
|
$groups = array();
|
||||||
|
}
|
||||||
|
$id_groups = array_keys($groups);
|
||||||
|
|
||||||
|
$all_actions = get_db_all_rows_filter('talert_actions', array('id_group' => $id_groups));
|
||||||
|
|
||||||
if ($all_actions === false)
|
if ($all_actions === false)
|
||||||
return array ();
|
return array ();
|
||||||
|
|
|
@ -30,6 +30,12 @@ if (is_ajax ()) {
|
||||||
$get_agent_module_last_value = (bool) get_parameter ('get_agent_module_last_value');
|
$get_agent_module_last_value = (bool) get_parameter ('get_agent_module_last_value');
|
||||||
$get_actions_alert_template = (bool) get_parameter("get_actions_alert_template");
|
$get_actions_alert_template = (bool) get_parameter("get_actions_alert_template");
|
||||||
|
|
||||||
|
$groups = get_user_groups(false, "AR", true);
|
||||||
|
if ($groups === false) {
|
||||||
|
$groups = array();
|
||||||
|
}
|
||||||
|
$id_groups = array_keys($groups);
|
||||||
|
|
||||||
if ($get_actions_alert_template) {
|
if ($get_actions_alert_template) {
|
||||||
$id_template = get_parameter("id_template");
|
$id_template = get_parameter("id_template");
|
||||||
$sql = sprintf ("SELECT t1.id, t1.name,
|
$sql = sprintf ("SELECT t1.id, t1.name,
|
||||||
|
@ -38,6 +44,7 @@ if (is_ajax ()) {
|
||||||
WHERE t2.id = %d
|
WHERE t2.id = %d
|
||||||
AND t2.id_alert_action = t1.id) as 'sort_order'
|
AND t2.id_alert_action = t1.id) as 'sort_order'
|
||||||
FROM talert_actions AS t1
|
FROM talert_actions AS t1
|
||||||
|
WHERE id_group IN (" . implode(',', $id_groups) . ")
|
||||||
ORDER BY sort_order DESC", $id_template);
|
ORDER BY sort_order DESC", $id_template);
|
||||||
|
|
||||||
$rows = get_db_all_rows_sql($sql);
|
$rows = get_db_all_rows_sql($sql);
|
||||||
|
|
Loading…
Reference in New Issue