2014-06-06 Hirofumi Kosaka <kosaka@rworks.jp>

* godmode/massive/massive_delete_agents.php,
	godmode/massive/massive_edit_agents.php: Fixed bug that all
	agents the user can view could be targets of the operation, if
	the user has an AW privilege for any agents.



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@10127 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
hkosaka 2014-06-06 09:25:55 +00:00
parent ed4fd07ac6
commit ebd6216a5a
3 changed files with 15 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2014-06-06 Hirofumi Kosaka <kosaka@rworks.jp>
* godmode/massive/massive_delete_agents.php,
godmode/massive/massive_edit_agents.php: Fixed bug that all
agents the user can view could be targets of the operation, if
the user has an AW privilege for any agents.
2014-06-06 Hirofumi Kosaka <kosaka@rworks.jp> 2014-06-06 Hirofumi Kosaka <kosaka@rworks.jp>
* godmode/massive/massive_add_alerts.php: Fixed bug that all * godmode/massive/massive_add_alerts.php: Fixed bug that all

View File

@ -102,7 +102,7 @@ $table->size[3] = '35%';
$table->data = array (); $table->data = array ();
$table->data[0][0] = __('Group'); $table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(false, "AR", true, $table->data[0][1] = html_print_select_groups(false, "AW", true,
'id_group', $id_group, false, '', '', true); 'id_group', $id_group, false, '', '', true);
$table->data[0][2] = __('Group recursion'); $table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion, $table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion,
@ -124,7 +124,7 @@ $table->data[2][0] .= '<span id="agent_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true); $table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>'; $table->data[2][0] .= '</span>';
$table->data[2][1] = html_print_select( $table->data[2][1] = html_print_select(
agents_get_group_agents($id_group, false, "none"), agents_get_group_agents(array_keys (users_get_groups ($config["id_user"], "AW", false)), false, "none"),
'id_agents[]', 0, false, '', '', true, true); 'id_agents[]', 0, false, '', '', true, true);
echo '<form method="post" id="form_agents" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents">'; echo '<form method="post" id="form_agents" action="index.php?sec=gmassive&sec2=godmode/massive/massive_operations&option=delete_agents">';
@ -157,6 +157,7 @@ ui_require_jquery_file ('pandora.controls');
return $("#status_agents").val(); return $("#status_agents").val();
}, },
agentSelect: "select#id_agents", agentSelect: "select#id_agents",
privilege: "AW",
recursion: function() { recursion: function() {
return recursion; return recursion;
} }

View File

@ -197,7 +197,7 @@ $table->size[3] = '35%';
$table->data = array (); $table->data = array ();
$table->data[0][0] = __('Group'); $table->data[0][0] = __('Group');
$table->data[0][1] = html_print_select_groups(false, "AR", true, $table->data[0][1] = html_print_select_groups(false, "AW", true,
'id_group', $id_group, false, '', '', true); 'id_group', $id_group, false, '', '', true);
$table->data[0][2] = __('Group recursion'); $table->data[0][2] = __('Group recursion');
$table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion, $table->data[0][3] = html_print_checkbox ("recursion", 1, $recursion,
@ -219,8 +219,8 @@ $table->data[2][0] = __('Agents');
$table->data[2][0] .= '<span id="agent_loading" class="invisible">'; $table->data[2][0] .= '<span id="agent_loading" class="invisible">';
$table->data[2][0] .= html_print_image('images/spinner.png', true); $table->data[2][0] .= html_print_image('images/spinner.png', true);
$table->data[2][0] .= '</span>'; $table->data[2][0] .= '</span>';
$enabled_agents = agents_get_group_agents ($id_group, array('disabled' => 0), "none"); $enabled_agents = agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false)), array('disabled' => 0), "none");
$all_agents = agents_get_group_agents ($id_group, array('disabled' => 1), "none") + $enabled_agents; $all_agents = agents_get_group_agents (array_keys (users_get_groups ($config["id_user"], "AW", false)), array('disabled' => 1), "none") + $enabled_agents;
$table->data[2][1] = html_print_select ($all_agents, $table->data[2][1] = html_print_select ($all_agents,
'id_agents[]', 0, false, '', '', true, true); 'id_agents[]', 0, false, '', '', true, true);
@ -249,7 +249,7 @@ $table->style = array ();
$table->style[0] = 'font-weight: bold; width: 150px;'; $table->style[0] = 'font-weight: bold; width: 150px;';
$table->data = array (); $table->data = array ();
$groups = users_get_groups ($config["id_user"], "AR",false); $groups = users_get_groups ($config["id_user"], "AW",false);
$agents = agents_get_group_agents (array_keys ($groups)); $agents = agents_get_group_agents (array_keys ($groups));
$table->data[0][0] = __('Parent'); $table->data[0][0] = __('Parent');
@ -480,6 +480,7 @@ $(document).ready (function () {
$("#id_group").pandoraSelectGroupAgent ({ $("#id_group").pandoraSelectGroupAgent ({
agentSelect: "select#id_agents", agentSelect: "select#id_agents",
privilege: "AW",
status_agents: function () { status_agents: function () {
return $("#status_agents").val(); return $("#status_agents").val();
}, },