summaryrefslogtreecommitdiff
path: root/extensions/source/config
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 15:44:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-14 20:38:31 +0200
commit9693b491295336955f7ce8359284b67a82ecf28f (patch)
tree0338cd2a61173c4c91dae5c85578e73a650f8702 /extensions/source/config
parent6e44d68b2beba30efc48bdaf3e8f00e236bf53f2 (diff)
loplugin:flatten in extensions
Change-Id: I58b5a2c12e464e568c4f66d398bbf0b1d8afc154 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92195 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions/source/config')
-rw-r--r--extensions/source/config/ldap/ldapaccess.cxx52
1 files changed, 26 insertions, 26 deletions
diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx
index 3e275e898443..7e35408b3b9e 100644
--- a/extensions/source/config/ldap/ldapaccess.cxx
+++ b/extensions/source/config/ldap/ldapaccess.cxx
@@ -106,43 +106,43 @@ void LdapConnection::connectSimple(const LdapDefinition& aDefinition)
void LdapConnection::connectSimple()
{
- if (!isValid())
- {
- // Connect to the server
- initConnection() ;
- // Set Protocol V3
- int version = LDAP_VERSION3;
- ldap_set_option(mConnection,
- LDAP_OPT_PROTOCOL_VERSION,
- &version);
+ if (isValid())
+ return;
+
+ // Connect to the server
+ initConnection() ;
+ // Set Protocol V3
+ int version = LDAP_VERSION3;
+ ldap_set_option(mConnection,
+ LDAP_OPT_PROTOCOL_VERSION,
+ &version);
#ifdef LDAP_X_OPT_CONNECT_TIMEOUT // OpenLDAP doesn't support this and the func
- /* timeout is specified in milliseconds -> 4 seconds*/
- int timeout = 4000;
+ /* timeout is specified in milliseconds -> 4 seconds*/
+ int timeout = 4000;
#ifdef _WIN32
- ldap_set_optionW( mConnection,
- LDAP_X_OPT_CONNECT_TIMEOUT,
- &timeout );
+ ldap_set_optionW( mConnection,
+ LDAP_X_OPT_CONNECT_TIMEOUT,
+ &timeout );
#else
- ldap_set_option( mConnection,
- LDAP_X_OPT_CONNECT_TIMEOUT,
- &timeout );
+ ldap_set_option( mConnection,
+ LDAP_X_OPT_CONNECT_TIMEOUT,
+ &timeout );
#endif
#endif
- // Do the bind
+ // Do the bind
#ifdef _WIN32
- LdapErrCode retCode = ldap_simple_bind_sW(mConnection,
- const_cast<PWSTR>(o3tl::toW(mLdapDefinition.mAnonUser.getStr())),
- const_cast<PWSTR>(o3tl::toW(mLdapDefinition.mAnonCredentials.getStr())) );
+ LdapErrCode retCode = ldap_simple_bind_sW(mConnection,
+ const_cast<PWSTR>(o3tl::toW(mLdapDefinition.mAnonUser.getStr())),
+ const_cast<PWSTR>(o3tl::toW(mLdapDefinition.mAnonCredentials.getStr())) );
#else
- LdapErrCode retCode = ldap_simple_bind_s(mConnection,
- OUStringToOString( mLdapDefinition.mAnonUser, RTL_TEXTENCODING_UTF8 ).getStr(),
- OUStringToOString( mLdapDefinition.mAnonCredentials, RTL_TEXTENCODING_UTF8 ).getStr()) ;
+ LdapErrCode retCode = ldap_simple_bind_s(mConnection,
+ OUStringToOString( mLdapDefinition.mAnonUser, RTL_TEXTENCODING_UTF8 ).getStr(),
+ OUStringToOString( mLdapDefinition.mAnonCredentials, RTL_TEXTENCODING_UTF8 ).getStr()) ;
#endif
- checkLdapReturnCode("SimpleBind", retCode) ;
- }
+ checkLdapReturnCode("SimpleBind", retCode) ;
}
void LdapConnection::initConnection()