mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-31 01:35:36 +02:00
Merge branch 'ent-6804-buscador-pandora-permite-acceder-politicas-open' into 'develop'
Ent 6804 buscador pandora permite acceder politicas open Closes pandora_enterprise#6804 See merge request artica/pandorafms!3688
This commit is contained in:
commit
2591d8874a
@ -1,15 +1,17 @@
|
|||||||
<?php
|
<?php
|
||||||
// Pandora FMS - http://pandorafms.com
|
/**
|
||||||
// ==================================================
|
* Pandora FMS - http://pandorafms.com
|
||||||
// Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
* ==================================================
|
||||||
// Please see http://pandorafms.org for full contribution list
|
* Copyright (c) 2005-2019 Artica Soluciones Tecnologicas
|
||||||
// This program is free software; you can redistribute it and/or
|
* Please see http://pandorafms.org for full contribution list
|
||||||
// modify it under the terms of the GNU General Public License
|
* This program is free software; you can redistribute it and/or
|
||||||
// as published by the Free Software Foundation; version 2
|
* modify it under the terms of the GNU General Public License
|
||||||
// This program is distributed in the hope that it will be useful,
|
* as published by the Free Software Foundation; version 2
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
* This program is distributed in the hope that it will be useful,
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
// GNU General Public License for more details.
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*/
|
||||||
require_once 'include/functions_messages.php';
|
require_once 'include/functions_messages.php';
|
||||||
require_once 'include/functions_servers.php';
|
require_once 'include/functions_servers.php';
|
||||||
require_once 'include/functions_notifications.php';
|
require_once 'include/functions_notifications.php';
|
||||||
@ -142,7 +144,7 @@ if ($config['menu_type'] == 'classic') {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET['sec'] == 'main' || !isset($_GET['sec'])) {
|
if ($_GET['sec'] == 'main' || !isset($_GET['sec'])) {
|
||||||
// home screen chosen by the user
|
// Home screen chosen by the user.
|
||||||
$home_page = '';
|
$home_page = '';
|
||||||
if (isset($config['id_user'])) {
|
if (isset($config['id_user'])) {
|
||||||
$user_info = users_get_user_by_id($config['id_user']);
|
$user_info = users_get_user_by_id($config['id_user']);
|
||||||
@ -169,6 +171,7 @@ if ($config['menu_type'] == 'classic') {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'Default':
|
case 'Default':
|
||||||
|
default:
|
||||||
$_GET['sec2'] = 'general/logon_ok';
|
$_GET['sec2'] = 'general/logon_ok';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -763,6 +766,7 @@ if ($config['menu_type'] == 'classic') {
|
|||||||
page: 'include/ajax/order_interpreter',
|
page: 'include/ajax/order_interpreter',
|
||||||
method: 'getResult',
|
method: 'getResult',
|
||||||
text: $('#keywords').val(),
|
text: $('#keywords').val(),
|
||||||
|
enterprise: <?php echo (int) enterprise_installed(); ?>,
|
||||||
},
|
},
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
$('#result_order').html(data);
|
$('#result_order').html(data);
|
||||||
|
@ -380,7 +380,7 @@ class OrderInterpreter extends Wizard
|
|||||||
|
|
||||||
// Take value from input search.
|
// Take value from input search.
|
||||||
$text = get_parameter('text', '');
|
$text = get_parameter('text', '');
|
||||||
$array_found = [];
|
$enterprise = (bool) get_parameter('enterprise', false);
|
||||||
$iterator = 0;
|
$iterator = 0;
|
||||||
$more_results = 0;
|
$more_results = 0;
|
||||||
|
|
||||||
@ -394,7 +394,7 @@ class OrderInterpreter extends Wizard
|
|||||||
__('GO TO '.$value['name'])
|
__('GO TO '.$value['name'])
|
||||||
) && $value['acl']
|
) && $value['acl']
|
||||||
) {
|
) {
|
||||||
if ($iterator <= 9) {
|
if ($iterator <= 9 && $this->canShowItem($enterprise, $this->pages_menu[$key]['url'])) {
|
||||||
echo '<li class="list_found" name="'.$iterator.'" id="'.$iterator.'">';
|
echo '<li class="list_found" name="'.$iterator.'" id="'.$iterator.'">';
|
||||||
echo '
|
echo '
|
||||||
Go to
|
Go to
|
||||||
@ -432,6 +432,28 @@ class OrderInterpreter extends Wizard
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Determines if the element must be shown or not.
|
||||||
|
*
|
||||||
|
* @param boolean $isEnterprise Define if the console is Enterprise.
|
||||||
|
* @param string $url Url of the element for select.
|
||||||
|
*
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
private function canShowItem(bool $isEnterprise, string $url)
|
||||||
|
{
|
||||||
|
$canShow = false;
|
||||||
|
|
||||||
|
$hasEnterpriseLocation = strpos($url, '&sec2=enterprise') !== false;
|
||||||
|
|
||||||
|
if (($isEnterprise === false && $hasEnterpriseLocation === false) || $isEnterprise === true) {
|
||||||
|
$canShow = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $canShow;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Load JS content.
|
* Load JS content.
|
||||||
* function to create JS actions.
|
* function to create JS actions.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user