summaryrefslogtreecommitdiffabout
path: root/kabc/plugins/ldap/resourceldap.cpp
Side-by-side diff
Diffstat (limited to 'kabc/plugins/ldap/resourceldap.cpp') (more/less context) (show whitespace changes)
-rw-r--r--kabc/plugins/ldap/resourceldap.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/kabc/plugins/ldap/resourceldap.cpp b/kabc/plugins/ldap/resourceldap.cpp
index 55c43af..c3097de 100644
--- a/kabc/plugins/ldap/resourceldap.cpp
+++ b/kabc/plugins/ldap/resourceldap.cpp
@@ -35,48 +35,55 @@ $Id$
#include <stdlib.h>
#include "resourceldap.h"
#include "resourceldapconfig.h"
using namespace KABC;
extern "C"
{
//US void *init_kabc_ldap()
void *init_microkabc_ldap()
{
return new KRES::PluginFactory<ResourceLDAP,ResourceLDAPConfig>();
}
}
void addModOp( LDAPMod ***pmods, const QString &attr, const QString &value );
ResourceLDAP::ResourceLDAP( const KConfig *config )
: Resource( config ), mPort( 389 ), mLdap( 0 )
{
KConfig *cfg = (KConfig *)config;
if ( cfg ) {
+#ifdef _WIN32_
+ // we use plugins on win32. the group is stored in a static variable
+ // such that group info not available on win32 plugins
+ // to fix that, it would be a looooot of work
+ if ( !cfg->tempGroup().isEmpty() )
+ cfg->setGroup( cfg->tempGroup() );
+#endif
mUser = cfg->readEntry( "LdapUser" );
mPassword = KStringHandler::obscure( cfg->readEntry( "LdapPassword" ) );
mDn = cfg->readEntry( "LdapDn" );
mHost = cfg->readEntry( "LdapHost" );
mPort = cfg->readNumEntry( "LdapPort", 389 );
mFilter = cfg->readEntry( "LdapFilter" );
mAnonymous = cfg->readBoolEntry( "LdapAnonymous" );
QStringList attributes = cfg->readListEntry( "LdapAttributes" );
for ( uint pos = 0; pos < attributes.count(); pos += 2 )
mAttributes.insert( attributes[ pos ], attributes[ pos + 1 ] );
}
/**
If you want to add new attributes, append them here, add a
translation string in the ctor of AttributesDialog and
handle them in the load() method below.
These are the default values from
*/
if ( mAttributes.count() == 0 ) {
mAttributes.insert( "commonName", "cn" );
mAttributes.insert( "formattedName", "displayName" );
mAttributes.insert( "familyName", "sn" );
mAttributes.insert( "givenName", "givenName" );