mirror of
https://github.com/Combodo/iTop.git
synced 2026-02-13 07:24:13 +01:00
* N°4789 - Parse datamodel module.xxx.php files instead of interpreting them - refactoring all in a dedicated service first * N°4789 - fix broken setup + tests * N°4789 - replace legacy eval by module file parsing * N°4789 - handle constants and if conditional structures * N°4789 - compute boolean expressions * N°4789 - make autoselect and dependencies work as well * cleanup * N°4789 - fix BeforeWritingConfig calls during setup * N°4789 - refactor and split in ModuleDiscoveryEvaluationService + handle ModuleInstallerAPI methods calls during setup * N°4789 - PR review changes with Romain * PR review + code cleanup + added usecases and test cover * temp evaluation work * replace eval by iTop custom evaluation classes * move PhpParser/Evaluation classes in a specific namespave + composer dumpautoload * fix broken setup * fix broken setup * complete Evaluators list + autoload * cleanup useless testing resources * cleanup + replace last eval call in VariableEvaluator * fix few Evaluators code * enhance nikic evaluators + test with/without nikic lib * Evaluator fixes/enhancements + tests * bump to nikic fork temporarly * bump nikic-parser fork + use only nikic fork evaluation + cleanup itop redondant evaluators * review with Romain: use distinct whitelists in setup time/runtime + move ModuleFileParser internal logic into ModuleFileReader * PhpExpressionEvaluator used via constructor and not as a service * dumpautoload again after rebase
81 lines
2.0 KiB
PHP
81 lines
2.0 KiB
PHP
<?php
|
|
|
|
|
|
// Until we develop a mean to adress this within the setup, let's check that this instance
|
|
// of PHP has the php_ldap extension
|
|
//
|
|
if (function_exists('ldap_connect'))
|
|
{
|
|
|
|
SetupWebPage::AddModule(
|
|
__FILE__, // Path to the current file, all other file names are relative to the directory containing this file
|
|
'authent-ldap/3.3.0',
|
|
array(
|
|
// Identification
|
|
//
|
|
'label' => 'User authentication based on LDAP',
|
|
'category' => 'authentication',
|
|
|
|
// Setup
|
|
//
|
|
'dependencies' => array(
|
|
),
|
|
'mandatory' => false,
|
|
'visible' => true,
|
|
'installer' => 'AuthentLDAPInstaller',
|
|
|
|
// Components
|
|
//
|
|
'datamodel' => array(
|
|
),
|
|
'data.struct' => array(
|
|
//'data.struct.authent-ldap.xml',
|
|
),
|
|
'data.sample' => array(
|
|
//'data.sample.authent-ldap.xml',
|
|
),
|
|
|
|
// Documentation
|
|
//
|
|
'doc.manual_setup' => '',
|
|
'doc.more_information' => '',
|
|
|
|
// Default settings
|
|
//
|
|
'settings' => array(
|
|
'uri' => 'ldap://localhost', // URI with host or IP address of your LDAP server
|
|
'default_user' => '', // User and password used for initial "Anonymous" bind to LDAP
|
|
'default_pwd' => '', // Leave both blank, if anonymous (read-only) bind is allowed
|
|
'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,
|
|
LDAP_OPT_REFERRALS => 0,
|
|
),
|
|
'start_tls' => false,
|
|
'debug' => false,
|
|
'servers' => array(),
|
|
),
|
|
)
|
|
);
|
|
|
|
// Module installation handler
|
|
//
|
|
class AuthentLDAPInstaller extends ModuleInstallerAPI
|
|
{
|
|
public static function AfterDataLoad(Config $oConfiguration, $sPreviousVersion, $sCurrentVersion)
|
|
{
|
|
|
|
}
|
|
|
|
public static function BeforeWritingConfig(Config $oConfiguration)
|
|
{
|
|
|
|
}
|
|
}
|
|
|
|
} // if (function_exists('ldap_connect'))
|