mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Add acl system in agent tab extesions
This commit is contained in:
parent
6f3ef53b3a
commit
7289996583
@ -20,7 +20,7 @@ $id_agente = get_parameter ("id_agente");
|
||||
$address = agents_get_address($id_agente);
|
||||
|
||||
if (!empty($address) || empty($id_agente)) {
|
||||
extensions_add_opemode_tab_agent ('network_tools','Network Tools','extensions/net_tools/nettool.png',"main_net_tools", "v1r1");
|
||||
extensions_add_opemode_tab_agent ('network_tools','Network Tools','extensions/net_tools/nettool.png',"main_net_tools", "v1r1", 'AW');
|
||||
}
|
||||
|
||||
function whereis_the_command ($command) {
|
||||
|
@ -20,7 +20,7 @@ $id_agente = get_parameter ("id_agente");
|
||||
$address = agents_get_address($id_agente);
|
||||
|
||||
if (!empty($address) || empty($id_agente)) {
|
||||
extensions_add_opemode_tab_agent ('ssh_gateway','SSH Gateway','extensions/ssh_gateway/secure_console.png',"ssh_gateway", "v1r1");
|
||||
extensions_add_opemode_tab_agent ('ssh_gateway','SSH Gateway','extensions/ssh_gateway/secure_console.png',"ssh_gateway", "v1r1", 'AW');
|
||||
}
|
||||
|
||||
function ssh_gateway () {
|
||||
|
@ -39,6 +39,6 @@ $id_agente = get_parameter ("id_agente");
|
||||
$address = agents_get_address($id_agente);
|
||||
|
||||
if (!empty($address) || empty($id_agente)) {
|
||||
extensions_add_opemode_tab_agent('vnc_view', __('VNC view'), 'images/vnc.png', 'vnc_view', "v1r1");
|
||||
extensions_add_opemode_tab_agent('vnc_view', __('VNC view'), 'images/vnc.png', 'vnc_view', "v1r1", 'AW');
|
||||
}
|
||||
?>
|
||||
|
@ -430,7 +430,7 @@ function extensions_add_godmode_tab_agent($tabId, $tabName, $tabIcon, $tabFuncti
|
||||
* @param tabIcon Path to the image icon
|
||||
* @param tabFunction Name of the function to execute when this extension is called
|
||||
*/
|
||||
function extensions_add_opemode_tab_agent($tabId, $tabName, $tabIcon, $tabFunction, $version="N/A") {
|
||||
function extensions_add_opemode_tab_agent($tabId, $tabName, $tabIcon, $tabFunction, $version = "N/A", $acl = 'AR') {
|
||||
global $config;
|
||||
global $extension_file;
|
||||
|
||||
@ -441,6 +441,7 @@ function extensions_add_opemode_tab_agent($tabId, $tabName, $tabIcon, $tabFuncti
|
||||
$extension['extension_ope_tab']['icon'] = $tabIcon;
|
||||
$extension['extension_ope_tab']['function'] = $tabFunction;
|
||||
$extension['extension_ope_tab']['version'] = $version;
|
||||
$extension['extension_ope_tab']['acl'] = $acl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1136,7 +1136,7 @@ if (isset($ehorus_tab) && !empty($ehorus_tab)) {
|
||||
//Tabs for extensions
|
||||
foreach ($config['extensions'] as $extension) {
|
||||
if (isset($extension['extension_ope_tab'])) {
|
||||
|
||||
if (check_acl($config['id_user'], $id_grupo, $extension['extension_ope_tab']['acl'])) {
|
||||
//VMware extension is only available for VMware OS
|
||||
if ($extension['extension_ope_tab']['id'] === "vmware_manager") {
|
||||
|
||||
@ -1188,6 +1188,7 @@ foreach ($config['extensions'] as $extension) {
|
||||
|
||||
$onheader = $onheader + array($id => $extension_tab);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$header_description = '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user