#12810 change value status license in diagnostics

This commit is contained in:
Daniel Cebrian 2024-02-02 10:47:36 +01:00
parent 67bbaa311c
commit d8fdb22c89
2 changed files with 24 additions and 20 deletions

View File

@ -483,7 +483,7 @@ class Diagnostics extends Wizard
],
'isEnterprise' => [
'name' => __('Enterprise installed'),
'value' => (enterprise_installed()) ? __('true') : __('false'),
'value' => $this->getStatusLicense(),
],
'customerKey' => [
'name' => __('Update Key'),
@ -505,6 +505,29 @@ class Diagnostics extends Wizard
}
/**
* Return status of license.
*
* @return string
*/
private function getStatusLicense():string
{
global $config;
if (enterprise_installed() === true) {
if (isset($config['license_mode'])
&& (int) $config['license_mode'] === 0
) {
return __('FREE/TRIAL');
} else {
return __('LICENCED');
}
} else {
return __('OpenSource');
}
}
/**
* PHP Status.
*

View File

@ -98,25 +98,6 @@ function update_manager_get_current_package()
}
/**
* Check if a trial license is in use.
*
* @return boolean true if a trial license is in use, false otherwise.
*/
function update_manager_verify_trial()
{
global $config;
if (isset($config['license_licensed_to'])
&& strstr($config['license_licensed_to'], 'info@pandorafms.com') !== false
) {
return true;
}
return false;
}
/**
* Checks if there are packages available to be installed.
*