#13312 new free license 2

This commit is contained in:
Daniel Maya 2024-04-30 15:14:36 +02:00
parent c285af503f
commit 115a869927
7 changed files with 25 additions and 19 deletions

View File

@ -121,6 +121,11 @@ foreach ($rows as $row) {
$settings->{$row['key']} = $row['value'];
}
if ($settings->customer_key === 'PANDORA-FREE') {
$license['limit'] = 50;
$license['license_mode'] = 'FREE';
}
?>
<script type="text/javascript">
var texts = {

View File

@ -81,7 +81,7 @@ if ($mode === Manager::MODE_ONLINE) {
enterprise_include_once('/include/functions_license.php');
$license_data = enterprise_hook('license_get_info');
if ($license_data !== ENTERPRISE_NOT_HOOK) {
if ($license_data !== ENTERPRISE_NOT_HOOK && $license !== 'PANDORA-FREE') {
$days_to_expiry = ((strtotime($license_data['expiry_date']) - time()) / (60 * 60 * 24));
if ((int) $license_data['limit_mode'] === 0) {

View File

@ -134,8 +134,8 @@ if ($stop_lts_modal === '0') {
}],
open: function(event, ui) {
$(".ui-dialog-titlebar-close").hide();
$("div.ui-dialog-buttonset").addClass('flex-rr-sb-important');
$("div.ui-dialog-buttonset").append(`
$(".ui-dialog-buttonpane").children(":first").addClass('flex-rr-sb-important');
$(".ui-dialog-buttonpane").children(":first").append(`
<div class="welcome-wizard-buttons">
<label class="flex-row-center">
<input type="checkbox" id="checkbox-no_show_more" class="welcome-wizard-do-not-show"/>

View File

@ -1926,6 +1926,9 @@ class DiscoveryTaskList extends HTML
// License precheck.
$license = enterprise_hook('license_get_info');
if (empty($license) === false && license_free() === true) {
$license['limit'] = 50;
}
if (is_array($license) === true
&& $n_agents > ($license['limit'] - $license['count_enabled'])

View File

@ -1175,6 +1175,10 @@ class HostDevices extends Wizard
// License precheck.
$license = enterprise_hook('license_get_info');
if (empty($license) === false && license_free() === true) {
$license['limit'] = 50;
}
$n_agents = 0;
foreach (explode(',', $this->task['subnet']) as $net) {
$mask = explode('/', $net, 2)[1];

View File

@ -1081,6 +1081,10 @@ class ConsoleSupervisor
{
global $config;
if (license_free() === true) {
return true;
}
$license = enterprise_hook('license_get_info');
if ($license === ENTERPRISE_NOT_HOOK) {
return false;

View File

@ -479,21 +479,14 @@ function api_get_license_remaining(
enterprise_include_once('include/functions_license.php');
$license = enterprise_hook('license_get_info');
if ($license === ENTERPRISE_NOT_HOOK) {
if (license_free()) {
returnData(
$returnType,
[
'type' => 'integer',
'data' => PHP_INT_MAX,
]
);
} else {
returnError('get-license', 'Failed to verify license.');
}
returnError('get-license', 'Failed to verify license.');
return;
}
if (license_free() === true) {
$license['limit'] = 50;
}
returnData(
$returnType,
[
@ -2315,10 +2308,7 @@ function api_set_delete_agent($id, $thrash1, $other, $returnType)
exit;
}
// Support for Pandora Enterprise.
if (license_free() === false) {
define('PANDORA_ENTERPRISE', true);
}
define('PANDORA_ENTERPRISE', true);
if ($agent_by_alias) {
$idsAgents = agents_get_agent_id_by_alias(io_safe_input($id));