9220 Restrict access to collections with nms license

This commit is contained in:
Pablo Aragon 2023-01-13 12:09:15 +01:00
parent c503836634
commit 4392bd7fa8
3 changed files with 16 additions and 6 deletions

View File

@ -26,8 +26,7 @@
* GNU General Public License for more details.
* ============================================================================
*/
$config['license_nms'] = 1;
// ! Eliminar!
// Begin.
require_once 'include/config.php';
require_once 'include/functions_menu.php';

View File

@ -141,11 +141,13 @@ if (isset($_GET['server'])) {
];
$buttons['collections'] = [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=collections&pure='.$pure.'">'.html_print_image('images/collection.png', true, ['title' => __('Collections')]).'</a>',
if ($config['license_nms'] !== 1) {
$buttons['collections'] = [
'active' => false,
'text' => '<a href="index.php?sec=gservers&sec2=godmode/servers/modificar_server&server_remote='.$id_server.'&ext='.$ext.'&tab=collections&pure='.$pure.'">'.html_print_image('images/collection.png', true, ['title' => __('Collections')]).'</a>',
];
];
}
}
$buttons[$tab]['active'] = true;

View File

@ -84,6 +84,15 @@ class SatelliteCollection extends HTML
return;
}
if ($config['license_nms'] === 1) {
db_pandora_audit(
AUDIT_LOG_NMS_VIOLATION,
'Trying to access satellite collections'
);
include $config['homedir'].'/general/noaccess.php';
return;
}
// Set the ajax controller.
$this->ajaxController = $ajaxController;
// Capture all parameters before start.