mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-09-26 11:29:12 +02:00
#13312 new free license 2
This commit is contained in:
parent
c285af503f
commit
115a869927
@ -121,6 +121,11 @@ foreach ($rows as $row) {
|
|||||||
$settings->{$row['key']} = $row['value'];
|
$settings->{$row['key']} = $row['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($settings->customer_key === 'PANDORA-FREE') {
|
||||||
|
$license['limit'] = 50;
|
||||||
|
$license['license_mode'] = 'FREE';
|
||||||
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var texts = {
|
var texts = {
|
||||||
|
@ -81,7 +81,7 @@ if ($mode === Manager::MODE_ONLINE) {
|
|||||||
|
|
||||||
enterprise_include_once('/include/functions_license.php');
|
enterprise_include_once('/include/functions_license.php');
|
||||||
$license_data = enterprise_hook('license_get_info');
|
$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));
|
$days_to_expiry = ((strtotime($license_data['expiry_date']) - time()) / (60 * 60 * 24));
|
||||||
|
|
||||||
if ((int) $license_data['limit_mode'] === 0) {
|
if ((int) $license_data['limit_mode'] === 0) {
|
||||||
|
@ -134,8 +134,8 @@ if ($stop_lts_modal === '0') {
|
|||||||
}],
|
}],
|
||||||
open: function(event, ui) {
|
open: function(event, ui) {
|
||||||
$(".ui-dialog-titlebar-close").hide();
|
$(".ui-dialog-titlebar-close").hide();
|
||||||
$("div.ui-dialog-buttonset").addClass('flex-rr-sb-important');
|
$(".ui-dialog-buttonpane").children(":first").addClass('flex-rr-sb-important');
|
||||||
$("div.ui-dialog-buttonset").append(`
|
$(".ui-dialog-buttonpane").children(":first").append(`
|
||||||
<div class="welcome-wizard-buttons">
|
<div class="welcome-wizard-buttons">
|
||||||
<label class="flex-row-center">
|
<label class="flex-row-center">
|
||||||
<input type="checkbox" id="checkbox-no_show_more" class="welcome-wizard-do-not-show"/>
|
<input type="checkbox" id="checkbox-no_show_more" class="welcome-wizard-do-not-show"/>
|
||||||
|
@ -1926,6 +1926,9 @@ class DiscoveryTaskList extends HTML
|
|||||||
|
|
||||||
// License precheck.
|
// License precheck.
|
||||||
$license = enterprise_hook('license_get_info');
|
$license = enterprise_hook('license_get_info');
|
||||||
|
if (empty($license) === false && license_free() === true) {
|
||||||
|
$license['limit'] = 50;
|
||||||
|
}
|
||||||
|
|
||||||
if (is_array($license) === true
|
if (is_array($license) === true
|
||||||
&& $n_agents > ($license['limit'] - $license['count_enabled'])
|
&& $n_agents > ($license['limit'] - $license['count_enabled'])
|
||||||
|
@ -1175,6 +1175,10 @@ class HostDevices extends Wizard
|
|||||||
|
|
||||||
// License precheck.
|
// License precheck.
|
||||||
$license = enterprise_hook('license_get_info');
|
$license = enterprise_hook('license_get_info');
|
||||||
|
if (empty($license) === false && license_free() === true) {
|
||||||
|
$license['limit'] = 50;
|
||||||
|
}
|
||||||
|
|
||||||
$n_agents = 0;
|
$n_agents = 0;
|
||||||
foreach (explode(',', $this->task['subnet']) as $net) {
|
foreach (explode(',', $this->task['subnet']) as $net) {
|
||||||
$mask = explode('/', $net, 2)[1];
|
$mask = explode('/', $net, 2)[1];
|
||||||
|
@ -1081,6 +1081,10 @@ class ConsoleSupervisor
|
|||||||
{
|
{
|
||||||
global $config;
|
global $config;
|
||||||
|
|
||||||
|
if (license_free() === true) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
$license = enterprise_hook('license_get_info');
|
$license = enterprise_hook('license_get_info');
|
||||||
if ($license === ENTERPRISE_NOT_HOOK) {
|
if ($license === ENTERPRISE_NOT_HOOK) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -479,21 +479,14 @@ function api_get_license_remaining(
|
|||||||
enterprise_include_once('include/functions_license.php');
|
enterprise_include_once('include/functions_license.php');
|
||||||
$license = enterprise_hook('license_get_info');
|
$license = enterprise_hook('license_get_info');
|
||||||
if ($license === ENTERPRISE_NOT_HOOK) {
|
if ($license === ENTERPRISE_NOT_HOOK) {
|
||||||
if (license_free()) {
|
returnError('get-license', 'Failed to verify license.');
|
||||||
returnData(
|
|
||||||
$returnType,
|
|
||||||
[
|
|
||||||
'type' => 'integer',
|
|
||||||
'data' => PHP_INT_MAX,
|
|
||||||
]
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
returnError('get-license', 'Failed to verify license.');
|
|
||||||
}
|
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (license_free() === true) {
|
||||||
|
$license['limit'] = 50;
|
||||||
|
}
|
||||||
|
|
||||||
returnData(
|
returnData(
|
||||||
$returnType,
|
$returnType,
|
||||||
[
|
[
|
||||||
@ -2315,10 +2308,7 @@ function api_set_delete_agent($id, $thrash1, $other, $returnType)
|
|||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Support for Pandora Enterprise.
|
define('PANDORA_ENTERPRISE', true);
|
||||||
if (license_free() === false) {
|
|
||||||
define('PANDORA_ENTERPRISE', true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($agent_by_alias) {
|
if ($agent_by_alias) {
|
||||||
$idsAgents = agents_get_agent_id_by_alias(io_safe_input($id));
|
$idsAgents = agents_get_agent_id_by_alias(io_safe_input($id));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user