mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
Modified ACL bit from AW to AD in scheduled downtimes TICKETS #3280
This commit is contained in:
parent
766964be4a
commit
ff3b61e3af
@ -19,7 +19,7 @@ global $config;
|
|||||||
check_login();
|
check_login();
|
||||||
|
|
||||||
$read_permisson = check_acl ($config['id_user'], 0, "AR");
|
$read_permisson = check_acl ($config['id_user'], 0, "AR");
|
||||||
$write_permisson = check_acl ($config['id_user'], 0, "AW");
|
$write_permisson = check_acl ($config['id_user'], 0, "AD");
|
||||||
|
|
||||||
if (! $read_permisson) {
|
if (! $read_permisson) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
@ -63,8 +63,8 @@ $stop_downtime = (bool) get_parameter ('stop_downtime');
|
|||||||
if ($stop_downtime) {
|
if ($stop_downtime) {
|
||||||
$downtime = db_get_row('tplanned_downtime', 'id', $id_downtime);
|
$downtime = db_get_row('tplanned_downtime', 'id', $id_downtime);
|
||||||
|
|
||||||
// Check AW permission on the downtime
|
// Check AD permission on the downtime
|
||||||
if (empty($downtime) || ! check_acl ($config['id_user'], $downtime['id_group'], "AW")) {
|
if (empty($downtime) || ! check_acl ($config['id_user'], $downtime['id_group'], "AD")) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
"Trying to access downtime scheduler");
|
"Trying to access downtime scheduler");
|
||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
@ -86,8 +86,8 @@ $delete_downtime = (int) get_parameter ('delete_downtime');
|
|||||||
if ($delete_downtime) {
|
if ($delete_downtime) {
|
||||||
$downtime = db_get_row('tplanned_downtime', 'id', $id_downtime);
|
$downtime = db_get_row('tplanned_downtime', 'id', $id_downtime);
|
||||||
|
|
||||||
// Check AW permission on the downtime
|
// Check AD permission on the downtime
|
||||||
if (empty($downtime) || ! check_acl ($config['id_user'], $downtime['id_group'], "AW")) {
|
if (empty($downtime) || ! check_acl ($config['id_user'], $downtime['id_group'], "AD")) {
|
||||||
db_pandora_audit("ACL Violation",
|
db_pandora_audit("ACL Violation",
|
||||||
"Trying to access downtime scheduler");
|
"Trying to access downtime scheduler");
|
||||||
require ("general/noaccess.php");
|
require ("general/noaccess.php");
|
||||||
@ -375,9 +375,9 @@ else {
|
|||||||
|
|
||||||
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
|
ui_pagination($downtimes_number, "index.php?sec=estado&sec2=godmode/agentes/planned_downtime.list&$filter_params_str", $offset);
|
||||||
|
|
||||||
// User groups with AW permission
|
// User groups with AD permission
|
||||||
$groupsAW = users_get_groups($config['id_user'], 'AW');
|
$groupsAD = users_get_groups($config['id_user'], 'AD');
|
||||||
$groupsAW = array_keys($groupsAW);
|
$groupsAD = array_keys($groupsAD);
|
||||||
|
|
||||||
// View available downtimes present in database (if any of them)
|
// View available downtimes present in database (if any of them)
|
||||||
$table = new StdClass();
|
$table = new StdClass();
|
||||||
@ -445,7 +445,7 @@ else {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// If user have writting permissions
|
// If user have writting permissions
|
||||||
if (in_array($downtime['id_group'], $groupsAW)) {
|
if (in_array($downtime['id_group'], $groupsAD)) {
|
||||||
// Stop button
|
// Stop button
|
||||||
if ($downtime['type_execution'] == 'once' && $downtime["executed"] == 1) {
|
if ($downtime['type_execution'] == 'once' && $downtime["executed"] == 1) {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user