H&D minor fixes and acl checks

Former-commit-id: cec9ec899e648ab6e76716333c8ee09ca875023a
This commit is contained in:
fbsanchez 2019-02-18 12:14:03 +01:00
parent 29206eb3bb
commit a1a429aa52
1 changed files with 12 additions and 3 deletions

View File

@ -439,9 +439,6 @@ class HostDevices extends Wizard
return; return;
} }
$user_groups = users_get_groups(false, 'AW', true, false, null, 'id_grupo');
$user_groups = array_keys($user_groups);
if ($this->parseNetScan() === false) { if ($this->parseNetScan() === false) {
// Error. // Error.
ui_print_error_message( ui_print_error_message(
@ -473,6 +470,17 @@ class HostDevices extends Wizard
], ],
]; ];
// Check ACL. If user is not able to manage target task,
// redirect him to main page.
if (users_is_admin() || check_acl(
$config['id_usuario'],
$this->task['id_group'],
'PM'
) !== true
) {
$form['form']['action'] = $this->url.'&mode=netscan&page='.($this->page - 1);
}
$this->printForm($form); $this->printForm($form);
return null; return null;
} }
@ -954,6 +962,7 @@ function SNMPExtraShow(target) {
$("#snmp_options_basic").hide(); $("#snmp_options_basic").hide();
$("#snmp_options_v3").hide(); $("#snmp_options_v3").hide();
if (document.getElementsByName("snmp_enabled")[0].checked) { if (document.getElementsByName("snmp_enabled")[0].checked) {
$("#snmp_extra").show();
if (target == 3) { if (target == 3) {
$("#snmp_options_v3").show(); $("#snmp_options_v3").show();
} else { } else {