{
String result = null;
boolean typeDetected = false;
// check OpenLDAP
IAttribute ocAttribute = rootDSE.getAttribute( "objectClass" ); //$NON-NLS-1$
if ( ocAttribute != null )
{
for ( int i = 0; i < ocAttribute.getStringValues().length; i++ )
{
if ( "OpenLDAProotDSE".equals( ocAttribute.getStringValues()[i] ) ) //$NON-NLS-1$
{
IAttribute ccAttribute = rootDSE.getAttribute( "configContext" ); //$NON-NLS-1$
if ( ccAttribute != null )
{
result = Messages.getString( "RootDSEPropertyPage.openLDAP23" ); //$NON-NLS-1$
typeDetected = true;
}
if ( !typeDetected )
{
IAttribute scAttribute = rootDSE.getAttribute( "supportedControl" ); //$NON-NLS-1$
if ( scAttribute != null )
{
for ( int sci = 0; sci < scAttribute.getStringValues().length; sci++ )
{
// if("1.2.840.113556.1.4.319".equals(scAttribute.getStringValues()[sci]))
// {
if ( "2.16.840.1.113730.3.4.18".equals( scAttribute.getStringValues()[sci] ) ) //$NON-NLS-1$
{
result = Messages.getString( "RootDSEPropertyPage.OpenLDAP22" ); //$NON-NLS-1$
typeDetected = true;
}
}
}
}
if ( !typeDetected )
{
IAttribute seAttribute = rootDSE.getAttribute( "supportedExtension" ); //$NON-NLS-1$
if ( seAttribute != null )
{
for ( int sei = 0; sei < seAttribute.getStringValues().length; sei++ )
{
if ( "1.3.6.1.4.1.4203.1.11.3".equals( seAttribute.getStringValues()[sei] ) ) //$NON-NLS-1$
{
result = Messages.getString( "RootDSEPropertyPage.OpenLDAP21" ); //$NON-NLS-1$
typeDetected = true;
}
}
}
}
if ( !typeDetected )
{
IAttribute sfAttribute = rootDSE.getAttribute( "supportedFeatures" ); //$NON-NLS-1$
if ( sfAttribute != null )
{
for ( int sfi = 0; sfi < sfAttribute.getStringValues().length; sfi++ )
{
if ( "1.3.6.1.4.1.4203.1.5.4".equals( sfAttribute.getStringValues()[sfi] ) ) //$NON-NLS-1$
{
result = Messages.getString( "RootDSEPropertyPage.OpenLDAP20" ); //$NON-NLS-1$
typeDetected = true;
}
}