Branch 'kolab/integration/4.13.0' - 2 commits - kldap/ldapconfigwidget.cpp kldap/ldapserver.cpp

Sandro Knauß knauss at kolabsys.com
Wed Jun 4 10:09:59 CEST 2014


 kldap/ldapconfigwidget.cpp |   19 ++++++-------------
 kldap/ldapserver.cpp       |    5 +++--
 2 files changed, 9 insertions(+), 15 deletions(-)

New commits:
commit 27a179a6847ae62b3d68033fe44bec7ddcf6c603
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Sun Jun 1 17:42:43 2014 +0200

    Use credentials in the "Edit Host" window to query LDAP Server.
    
    If the server needs authentification to connect, the "Query Server"
    to get the namingcontexts should use the credentials.
    
    BUG: 335651
    FIXED-IN: 4.13.2
    FEATURE: 118496

diff --git a/kldap/ldapconfigwidget.cpp b/kldap/ldapconfigwidget.cpp
index 703adf2..5de51ad 100644
--- a/kldap/ldapconfigwidget.cpp
+++ b/kldap/ldapconfigwidget.cpp
@@ -321,27 +321,20 @@ void LdapConfigWidget::Private::initWidget()
 
 void LdapConfigWidget::Private::sendQuery()
 {
-  LdapUrl _url;
+  LdapServer _server( mParent->server() );
 
   mQResult.clear();
   mCancelled = true;
 
-  _url.setProtocol( ( mSecSSL && mSecSSL->isChecked() ) ? QLatin1String("ldaps") : QLatin1String("ldap") );
-  if ( mHost ) {
-    _url.setHost( mHost->text() );
-  }
-  if ( mPort ) {
-    _url.setPort( mPort->value() );
+  if ( mAttr == QLatin1String("supportedsaslmechanisms") ) {
+    _server.setAuth( LdapServer::Anonymous );
   }
+
+  LdapUrl _url( _server.url() );
+
   _url.setDn( LdapDN( QLatin1String("") ) );
   _url.setAttributes( QStringList( mAttr ) );
   _url.setScope( LdapUrl::Base );
-  if ( mVersion ) {
-    _url.setExtension( QLatin1String("x-ver"), QString::number( mVersion->value() ) );
-  }
-  if ( mSecTLS && mSecTLS->isChecked() ) {
-    _url.setExtension( QLatin1String("x-tls"), QLatin1String("") );
-  }
 
   kDebug() << "sendQuery url:" << _url.prettyUrl();
 


commit 4faf7c48b575c3ccd399431b8aa7b91f43e7d542
Author: Sandro Knauß <knauss at kolabsys.com>
Date:   Mon Jun 2 14:11:40 2014 +0200

    Anonymous login means no user and password are used

diff --git a/kldap/ldapserver.cpp b/kldap/ldapserver.cpp
index 854c97d..f8ec5e1 100644
--- a/kldap/ldapserver.cpp
+++ b/kldap/ldapserver.cpp
@@ -352,12 +352,12 @@ LdapUrl LdapServer::url() const
   url.setProtocol( d->mSecurity == SSL ? QLatin1String("ldaps") : QLatin1String("ldap") );
   url.setPort( d->mPort );
   url.setHost( d->mHost );
-  url.setPassword( d->mPassword );
   url.setDn( d->mBaseDn );
   url.setFilter( d->mFilter );
   url.setScope( d->mScope );
   if ( d->mAuth == SASL ) {
     url.setUser( d->mUser );
+    url.setPassword( d->mPassword );
     url.setExtension( QLatin1String("bindname"), d->mBindDn, true );
     url.setExtension( QLatin1String("x-sasl"), QString() );
     if ( !d->mMech.isEmpty() ) {
@@ -366,8 +366,9 @@ LdapUrl LdapServer::url() const
     if ( !d->mRealm.isEmpty() ) {
       url.setExtension( QLatin1String("x-realm"), d->mRealm );
     }
-  } else {
+  } else if (d->mAuth == Simple ) {
     url.setUser( d->mBindDn );
+    url.setPassword( d->mPassword );
   }
   if ( d->mVersion == 2 ) {
     url.setExtension( QLatin1String("x-version"), d->mVersion );




More information about the commits mailing list