cleanup useless testing resources

This commit is contained in:
odain
2025-09-03 17:11:49 +02:00
parent c14ac90a13
commit cdbe331c35
3 changed files with 4 additions and 120 deletions

View File

@@ -34,7 +34,7 @@ SetupWebPage::AddModule(
'data.sample' => array(
//'data.sample.authent-ldap.xml',
),
// Documentation
//
'doc.manual_setup' => '',
@@ -49,7 +49,7 @@ SetupWebPage::AddModule(
'base_dn' => 'dc=yourcompany,dc=com', // Base DN for User queries, adjust it to your LDAP schema
'user_query' => '(&(uid=%1$s)(inetuserstatus=ACTIVE))', // Query used to retrieve each user %1$s => iTop login
// For Windows AD use (samaccountname=%1$s) or (userprincipalname=%1$s)
// Some extra LDAP options, refer to: http://www.php.net/manual/en/function.ldap-set-option.php for more info
'options' => array(
LDAP_OPT_PROTOCOL_VERSION => 3,
@@ -68,32 +68,12 @@ class AuthentLDAPInstaller extends ModuleInstallerAPI
{
public static function AfterDataLoad(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
{
// Create missing table entries
$sUserLDAPTable = MetaModel::DBGetTable('UserLDAP');
$sUserTable = MetaModel::DBGetTable('User');
$sSQL = "insert into $sUserLDAPTable (id) select U.id from $sUserTable as U left join $sUserLDAPTable as L on U.id = L.id where U.finalclass='UserLDAP' and isnull(L.id);";
CMDBSource::Query($sSQL);
}
public static function BeforeWritingConfig(Config $oConfiguration)
{
$sURI = $oConfiguration->GetModuleSetting('authent-ldap', 'uri');
if (empty($sURI)) {
$sLDAPHost = MetaModel::GetModuleSetting('authent-ldap', 'host', 'localhost');
$iLDAPPort = MetaModel::GetModuleSetting('authent-ldap', 'port', 389);
$sURI = preg_match('#^ldaps?://#i', $sLDAPHost) ? $sLDAPHost : 'ldap://'.$sLDAPHost.':'.$iLDAPPort;
$oConfiguration->SetModuleSetting('authent-ldap', 'uri', $sURI);
}
$aServers = $oConfiguration->GetModuleSetting('authent-ldap', 'servers', []);
foreach ($aServers as &$aServer) {
if (!array_key_exists($aServer, 'uri')) {
$sLDAPHost = $aServerParams['host'] ?? 'localhost';
$iLDAPPort = $aServerParams['port'] ?? 389;
$aServer['uri'] = preg_match('#^ldaps?://#i', $sLDAPHost) ? $sLDAPHost : 'ldap://'.$sLDAPHost.':'.$iLDAPPort;
}
}
$oConfiguration->SetModuleSetting('authent-ldap', 'servers', $aServers);
}
}

View File

@@ -1,57 +0,0 @@
<?php
/**
*
* @copyright Copyright (C) 2010-2019 Combodo SARL
* @license https://www.combodo.com/documentation/combodo-software-license.html
*
*/
//
// iTop module definition file
//
SetupWebPage::AddModule(
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
'combodo-make-it-vip/1.2.0',
array(
// Identification
//
'label' => 'Flag important contacts in your database and highlight tickets',
'category' => 'business',
// Setup
//
'dependencies' => array(
'itop-config-mgmt/2.0.0'||'itop-structure/3.0.0',
'itop-request-mgmt/2.0.0||itop-request-mgmt-itil/2.0.0||itop-incident-mgmt-itil/2.0.0',
),
'mandatory' => false,
'visible' => true,
// Components
//
'datamodel' => array(
'model.combodo-make-it-vip.php',
'main.combodo-make-it-vip.php',
),
'webservice' => array(
),
'data.struct' => array(
// add your 'structure' definition XML files here,
),
'data.sample' => array(
// add your sample data XML files here,
),
// Documentation
//
'doc.manual_setup' => '', // hyperlink to manual setup documentation, if any
'doc.more_information' => '', // hyperlink to more information, if any
// Default settings
//
'settings' => array(
// Module specific settings go here, if any
),
)
);

View File

@@ -21,15 +21,6 @@ SetupWebPage::AddModule(
//
'dependencies' => array(
'itop-portal-base/3.2.0',
'approval-base/2.5.1',
'combodo-approval-extended/1.2.3',
'itop-config-mgmt/3.2.0',
'itop-tickets/3.2.0',
'combodo-dispatch-userrequest/1.1.4',
'itop-request-mgmt-itil/3.2.0||itop-request-mgmt/3.2.0',
'itop-service-mgmt/3.2.0||itop-service-mgmt-provider/3.2.0',
'itop-request-template/2.0.1',
'itop-request-template-portal/1.0.0',
),
'mandatory' => false,
'visible' => true,
@@ -39,12 +30,6 @@ SetupWebPage::AddModule(
//
'datamodel' => array(
'vendor/autoload.php',
// Explicitly load hooks classes
'src/Hook/GRPopupMenuExtension.php',
// Explicitly load DM classes
'model.itop-global-requests-mgmt.php',
//Needed for symfony dependency injection
'src/Portal/Router/GlobalRequestBrickRouter.php',
),
'webservice' => array(),
'data.struct' => array(// add your 'structure' definition XML files here,
@@ -83,31 +68,7 @@ class GlobalRequestInstaller extends ModuleInstallerAPI
*/
public static function AfterDatabaseCreation(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
{
if (strlen($sPreviousVersion) > 0 && version_compare($sPreviousVersion, '1.6.0', '<')) {
$slnkGRTypeToServiceSubcategory = MetaModel::DBGetTable('lnkGRTypeToServiceSubcategory','parent_servicesubcategory_id');
$oAttDefToUpdate = MetaModel::GetAttributeDef('lnkGRTypeToServiceSubcategory', 'parent_servicesubcategory_id');
$aColumnsToUpdate = array_keys($oAttDefToUpdate->GetSQLColumns());
$sColumnToUpdate = $aColumnsToUpdate[0]; // We know that a string has only one column*/
$oAttDefLink = MetaModel::GetAttributeDef('lnkGRTypeToServiceSubcategory', 'servicesubcategory_id');
$aColumnsLink = array_keys($oAttDefLink->GetSQLColumns());
$sColumnLink = $aColumnsLink[0]; // We know that a string has only one column*/
$sTableToRead = MetaModel::DBGetTable('ServiceSubcategory', 'parent_servicesubcategory_id');
$oAttDefToRead = MetaModel::GetAttributeDef('ServiceSubcategory', 'parent_servicesubcategory_id');
$aColumnsToReads = array_keys($oAttDefToRead->GetSQLColumns());
$sColumnToRead = $aColumnsToReads[0]; // We know that a string has only one column
$sTableToReadPrimaryKey = MetaModel::DBGetKey('ServiceSubcategory');
$sQueryUpdate = "
UPDATE `$slnkGRTypeToServiceSubcategory`
JOIN `$sTableToRead`
ON `$slnkGRTypeToServiceSubcategory`.`$sColumnLink` = `$sTableToRead`.`$sTableToReadPrimaryKey`
SET `$slnkGRTypeToServiceSubcategory`.`$sColumnToUpdate` = `$sTableToRead`.`$sColumnToRead`
WHERE `$slnkGRTypeToServiceSubcategory`.`$sColumnToUpdate` = 0 OR `$slnkGRTypeToServiceSubcategory`.`$sColumnToUpdate` IS NULL
";
SetupLog::Info(" GlobalRequestInstaller Query: " . $sQueryUpdate);
CMDBSource::Query($sQueryUpdate);
}
//code
}
}