#12905 deprecated discovery legacy
This commit is contained in:
parent
78a46c3b1f
commit
0dd3d14d30
|
@ -1738,3 +1738,12 @@ extensions/files_repo/sql/files_repo.sql
|
||||||
extensions/files_repo
|
extensions/files_repo
|
||||||
extensions/resource_exportation.php
|
extensions/resource_exportation.php
|
||||||
extensions/resource_registration.php
|
extensions/resource_registration.php
|
||||||
|
enterprise/include/class/Aws.cloud.php
|
||||||
|
enterprise/include/class/Azure.cloud.php
|
||||||
|
enterprise/include/class/DB2.app.php
|
||||||
|
enterprise/include/class/Google.cloud.php
|
||||||
|
enterprise/include/class/MicrosoftSQLServer.app.php
|
||||||
|
enterprise/include/class/MySQL.app.php
|
||||||
|
enterprise/include/class/Oracle.app.php
|
||||||
|
enterprise/include/class/SAP.app.php
|
||||||
|
enterprise/include/class/VMware.app.php
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -81,16 +81,6 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
|
||||||
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
if ((bool) check_acl($config['id_user'], 0, 'AW') === true) {
|
||||||
// Applications.
|
// Applications.
|
||||||
$sub2 = [];
|
$sub2 = [];
|
||||||
// Check if app has been migrated.
|
|
||||||
if (enterprise_installed() === true) {
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.mssql') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=MicrosoftSQLServer']['text'] = __('Microsoft SQL Server (legacy)'));
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.mysql') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=mysql']['text'] = __('Mysql (legacy)'));
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.oracle') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=oracle']['text'] = __('Oracle (legacy)'));
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.vmware') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=vmware']['text'] = __('VMware (legacy)'));
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.sap.desert') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=SAP']['text'] = __('SAP (legacy)'));
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.db2') === true) ?: ($sub2['godmode/servers/discovery&wiz=app&mode=DB2']['text'] = __('DB2 (legacy)'));
|
|
||||||
}
|
|
||||||
|
|
||||||
$extensions = ManageExtensions::getExtensionBySection('app');
|
$extensions = ManageExtensions::getExtensionBySection('app');
|
||||||
if ($extensions !== false) {
|
if ($extensions !== false) {
|
||||||
foreach ($extensions as $key => $extension) {
|
foreach ($extensions as $key => $extension) {
|
||||||
|
@ -112,13 +102,6 @@ if ((bool) check_acl($config['id_user'], 0, 'AR') === true
|
||||||
|
|
||||||
// Cloud.
|
// Cloud.
|
||||||
$sub2 = [];
|
$sub2 = [];
|
||||||
if (enterprise_installed() === true) {
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.aws.ec2') === true) ?: (ManageExtensions::isMigrated('pandorafms.aws.s3') === true) ?: (ManageExtensions::isMigrated('pandorafms.aws.rds') === true) ?: ($sub2['godmode/servers/discovery&wiz=cloud&mode=amazonws']['text'] = __('Amazon Web Services (legacy)'));
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.azure.mc') === true) ?: ($sub2['godmode/servers/discovery&wiz=cloud&mode=azure']['text'] = __('Microsoft Azure (legacy)'));
|
|
||||||
(ManageExtensions::isMigrated('pandorafms.azure.gcp.ce') === true) ?: ($sub2['godmode/servers/discovery&wiz=cloud&mode=gcp']['text'] = __('Google Compute Platform (legacy)'));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$extensions = ManageExtensions::getExtensionBySection('cloud');
|
$extensions = ManageExtensions::getExtensionBySection('cloud');
|
||||||
if ($extensions !== false) {
|
if ($extensions !== false) {
|
||||||
foreach ($extensions as $key => $extension) {
|
foreach ($extensions as $key => $extension) {
|
||||||
|
|
|
@ -107,148 +107,71 @@ class Applications extends Wizard
|
||||||
);
|
);
|
||||||
|
|
||||||
$mode = get_parameter('mode', null);
|
$mode = get_parameter('mode', null);
|
||||||
|
|
||||||
// Load application wizards.
|
|
||||||
$enterprise_classes = glob(
|
|
||||||
$config['homedir'].'/'.ENTERPRISE_DIR.'/include/class/*.app.php'
|
|
||||||
);
|
|
||||||
$extensions = new ExtensionsDiscovery('app', $mode);
|
$extensions = new ExtensionsDiscovery('app', $mode);
|
||||||
|
|
||||||
foreach ($enterprise_classes as $classpath) {
|
if ($mode !== null) {
|
||||||
enterprise_include_once(
|
// Load extension if exist.
|
||||||
'include/class/'.basename($classpath)
|
$extensions->run();
|
||||||
);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($mode) {
|
$this->prepareBreadcrum(
|
||||||
case 'DB2':
|
[
|
||||||
$classname_selected = 'DB2';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'SAP':
|
|
||||||
$classname_selected = 'SAP';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'vmware':
|
|
||||||
$classname_selected = 'VMware';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'mysql':
|
|
||||||
$classname_selected = 'MySQL';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'oracle':
|
|
||||||
$classname_selected = 'Oracle';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'MicrosoftSQLServer':
|
|
||||||
$classname_selected = 'MicrosoftSQLServer';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$classname_selected = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Else: class not found pseudo exception.
|
|
||||||
if ($classname_selected !== null) {
|
|
||||||
$wiz = new $classname_selected($this->page);
|
|
||||||
// Check if app has been migrated.
|
|
||||||
if (method_exists($wiz, 'isMigrated') === true) {
|
|
||||||
if ($wiz->isMigrated() === true) {
|
|
||||||
ui_print_info_message(__('This legacy app has been migrated to new discovery 2.0 system'));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $wiz->run();
|
|
||||||
if (is_array($result) === true) {
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($classname_selected === null) {
|
|
||||||
if ($mode !== null) {
|
|
||||||
// Load extension if exist.
|
|
||||||
$extensions->run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load classes and print selector.
|
|
||||||
$wiz_data = [];
|
|
||||||
foreach ($enterprise_classes as $classpath) {
|
|
||||||
$classname = basename($classpath, '.app.php');
|
|
||||||
$obj = new $classname();
|
|
||||||
|
|
||||||
if (method_exists($obj, 'isMigrated') === true) {
|
|
||||||
if ($obj->isMigrated() === true) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$wiz_data[] = $obj->load();
|
|
||||||
}
|
|
||||||
|
|
||||||
$wiz_data = array_merge($wiz_data, $extensions->loadExtensions());
|
|
||||||
|
|
||||||
$this->prepareBreadcrum(
|
|
||||||
[
|
[
|
||||||
[
|
'link' => ui_get_full_url(
|
||||||
'link' => ui_get_full_url(
|
'index.php?sec=gservers&sec2=godmode/servers/discovery'
|
||||||
'index.php?sec=gservers&sec2=godmode/servers/discovery'
|
|
||||||
),
|
|
||||||
'label' => __('Discovery'),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'link' => ui_get_full_url(
|
|
||||||
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=app'
|
|
||||||
),
|
|
||||||
'label' => __('Applications'),
|
|
||||||
'selected' => true,
|
|
||||||
],
|
|
||||||
]
|
|
||||||
);
|
|
||||||
|
|
||||||
// Header.
|
|
||||||
ui_print_page_header(
|
|
||||||
__('Applications'),
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
GENERIC_SIZE_TEXT,
|
|
||||||
'',
|
|
||||||
$this->printHeader(true)
|
|
||||||
);
|
|
||||||
|
|
||||||
Wizard::printBigButtonsList($wiz_data);
|
|
||||||
|
|
||||||
$not_defined_extensions = $extensions->loadExtensions(true);
|
|
||||||
|
|
||||||
$output = html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'agent_details_line',
|
|
||||||
'content' => ui_toggle(
|
|
||||||
Wizard::printBigButtonsList($not_defined_extensions, true),
|
|
||||||
'<span class="subsection_header_title">'.__('Not installed').'</span>',
|
|
||||||
'not_defined_apps',
|
|
||||||
'not_defined_apps',
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'box-flat white_table_graph w100p'
|
|
||||||
),
|
),
|
||||||
|
'label' => __('Discovery'),
|
||||||
],
|
],
|
||||||
);
|
[
|
||||||
|
'link' => ui_get_full_url(
|
||||||
|
'index.php?sec=gservers&sec2=godmode/servers/discovery&wiz=app'
|
||||||
|
),
|
||||||
|
'label' => __('Applications'),
|
||||||
|
'selected' => true,
|
||||||
|
],
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
echo $output;
|
// Header.
|
||||||
|
ui_print_page_header(
|
||||||
|
__('Applications'),
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
GENERIC_SIZE_TEXT,
|
||||||
|
'',
|
||||||
|
$this->printHeader(true)
|
||||||
|
);
|
||||||
|
|
||||||
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
|
Wizard::printBigButtonsList($extensions->loadExtensions());
|
||||||
}
|
|
||||||
|
$not_defined_extensions = $extensions->loadExtensions(true);
|
||||||
|
|
||||||
|
$output = html_print_div(
|
||||||
|
[
|
||||||
|
'class' => 'agent_details_line',
|
||||||
|
'content' => ui_toggle(
|
||||||
|
Wizard::printBigButtonsList($not_defined_extensions, true),
|
||||||
|
'<span class="subsection_header_title">'.__('Not installed').'</span>',
|
||||||
|
'not_defined_apps',
|
||||||
|
'not_defined_apps',
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'box-flat white_table_graph w100p'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
echo $output;
|
||||||
|
|
||||||
|
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,8 +114,6 @@ class Cloud extends Wizard
|
||||||
*/
|
*/
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
global $config;
|
|
||||||
|
|
||||||
// Load styles.
|
// Load styles.
|
||||||
parent::run();
|
parent::run();
|
||||||
|
|
||||||
|
@ -127,139 +125,74 @@ class Cloud extends Wizard
|
||||||
|
|
||||||
$mode = get_parameter('mode', null);
|
$mode = get_parameter('mode', null);
|
||||||
|
|
||||||
// Load cloud wizards.
|
|
||||||
$enterprise_classes = glob(
|
|
||||||
$config['homedir'].'/'.ENTERPRISE_DIR.'/include/class/*.cloud.php'
|
|
||||||
);
|
|
||||||
$extensions = new ExtensionsDiscovery('cloud', $mode);
|
$extensions = new ExtensionsDiscovery('cloud', $mode);
|
||||||
|
|
||||||
foreach ($enterprise_classes as $classpath) {
|
if ($mode !== null) {
|
||||||
enterprise_include_once(
|
// Load extension if exist.
|
||||||
'include/class/'.basename($classpath)
|
$extensions->run();
|
||||||
);
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch ($mode) {
|
// Load classes and print selector.
|
||||||
case 'amazonws':
|
$this->prepareBreadcrum(
|
||||||
$classname_selected = 'Aws';
|
[
|
||||||
break;
|
|
||||||
|
|
||||||
case 'azure':
|
|
||||||
$classname_selected = 'Azure';
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'gcp':
|
|
||||||
$classname_selected = 'Google';
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
$classname_selected = null;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Else: class not found pseudo exception.
|
|
||||||
if ($classname_selected !== null) {
|
|
||||||
$wiz = new $classname_selected($this->page);
|
|
||||||
// Check if app has been migrated.
|
|
||||||
if (method_exists($wiz, 'isMigrated') === true) {
|
|
||||||
if ($wiz->isMigrated() === true) {
|
|
||||||
ui_print_info_message(__('This legacy app has been migrated to new discovery 2.0 system'));
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$result = $wiz->run();
|
|
||||||
if (is_array($result) === true) {
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($classname_selected === null) {
|
|
||||||
if ($mode !== null) {
|
|
||||||
// Load extension if exist.
|
|
||||||
$extensions->run();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Load classes and print selector.
|
|
||||||
$wiz_data = [];
|
|
||||||
foreach ($enterprise_classes as $classpath) {
|
|
||||||
$classname = basename($classpath, '.cloud.php');
|
|
||||||
$obj = new $classname();
|
|
||||||
// Check if legacy has been migrated.
|
|
||||||
if (method_exists($obj, 'isMigrated') === true) {
|
|
||||||
if ($obj->isMigrated() === true) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
$wiz_data[] = $obj->load();
|
|
||||||
}
|
|
||||||
|
|
||||||
$wiz_data = array_merge($wiz_data, $extensions->loadExtensions());
|
|
||||||
|
|
||||||
$this->prepareBreadcrum(
|
|
||||||
[
|
[
|
||||||
[
|
'link' => ui_get_full_url(
|
||||||
'link' => ui_get_full_url(
|
'index.php?sec=gservers&sec2=godmode/servers/discovery'
|
||||||
'index.php?sec=gservers&sec2=godmode/servers/discovery'
|
|
||||||
),
|
|
||||||
'label' => __('Discovery'),
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'link' => $this->url,
|
|
||||||
'label' => __('Cloud'),
|
|
||||||
'selected' => true,
|
|
||||||
],
|
|
||||||
],
|
|
||||||
true
|
|
||||||
);
|
|
||||||
|
|
||||||
// Header.
|
|
||||||
ui_print_page_header(
|
|
||||||
__('Cloud'),
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
false,
|
|
||||||
'',
|
|
||||||
GENERIC_SIZE_TEXT,
|
|
||||||
'',
|
|
||||||
$this->printHeader(true)
|
|
||||||
);
|
|
||||||
|
|
||||||
Wizard::printBigButtonsList($wiz_data);
|
|
||||||
|
|
||||||
$not_defined_extensions = $extensions->loadExtensions(true);
|
|
||||||
|
|
||||||
$output = html_print_div(
|
|
||||||
[
|
|
||||||
'class' => 'agent_details_line',
|
|
||||||
'content' => ui_toggle(
|
|
||||||
Wizard::printBigButtonsList($not_defined_extensions, true),
|
|
||||||
'<span class="subsection_header_title">'.__('Not installed').'</span>',
|
|
||||||
'not_defined_apps',
|
|
||||||
'not_defined_apps',
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
'',
|
|
||||||
'',
|
|
||||||
'box-flat white_table_graph w100p'
|
|
||||||
),
|
),
|
||||||
|
'label' => __('Discovery'),
|
||||||
],
|
],
|
||||||
);
|
[
|
||||||
|
'link' => $this->url,
|
||||||
|
'label' => __('Cloud'),
|
||||||
|
'selected' => true,
|
||||||
|
],
|
||||||
|
],
|
||||||
|
true
|
||||||
|
);
|
||||||
|
|
||||||
echo $output;
|
// Header.
|
||||||
|
ui_print_page_header(
|
||||||
|
__('Cloud'),
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
false,
|
||||||
|
'',
|
||||||
|
GENERIC_SIZE_TEXT,
|
||||||
|
'',
|
||||||
|
$this->printHeader(true)
|
||||||
|
);
|
||||||
|
|
||||||
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
|
Wizard::printBigButtonsList($extensions->loadExtensions());
|
||||||
}
|
|
||||||
|
$not_defined_extensions = $extensions->loadExtensions(true);
|
||||||
|
|
||||||
|
$output = html_print_div(
|
||||||
|
[
|
||||||
|
'class' => 'agent_details_line',
|
||||||
|
'content' => ui_toggle(
|
||||||
|
Wizard::printBigButtonsList($not_defined_extensions, true),
|
||||||
|
'<span class="subsection_header_title">'.__('Not installed').'</span>',
|
||||||
|
'not_defined_apps',
|
||||||
|
'not_defined_apps',
|
||||||
|
false,
|
||||||
|
true,
|
||||||
|
'',
|
||||||
|
'',
|
||||||
|
'box-flat white_table_graph w100p'
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
|
||||||
|
echo $output;
|
||||||
|
|
||||||
|
echo '<div class="app_mssg"><i>*'.__('All company names used here are for identification purposes only. Use of these names, logos, and brands does not imply endorsement.').'</i></div>';
|
||||||
|
|
||||||
// Print Warning Message.
|
// Print Warning Message.
|
||||||
$this->printWarningMessage();
|
$this->printWarningMessage();
|
||||||
|
|
||||||
return $result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue