summaryrefslogtreecommitdiff
path: root/extensions/source/config/ldap
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-06-03 11:46:51 +0200
committerStephan Bergmann <sbergman@redhat.com>2020-06-03 22:39:11 +0200
commit3d3cb4328ece843b3e31b8411f9d16bbedb57a7b (patch)
treeccf8a174c02c384de787d0d7f6a1cbcb0c9e4f6c /extensions/source/config/ldap
parent6d1b19df4e9cd066acf57b57c3a8b68e09a43ff0 (diff)
Upcoming loplugin:elidestringvar: extensions
Change-Id: I318eebbdc79c503b10570061a298eb76d6555540 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95402 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'extensions/source/config/ldap')
-rw-r--r--extensions/source/config/ldap/ldapuserprofilebe.cxx30
1 files changed, 10 insertions, 20 deletions
diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx
index 897965ab64a9..fdb6ccba9b77 100644
--- a/extensions/source/config/ldap/ldapuserprofilebe.cxx
+++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx
@@ -87,16 +87,6 @@ bool LdapUserProfileBe::readLdapConfiguration(
LdapDefinition * definition, OUString * loggedOnUser)
{
OSL_ASSERT(context.is() && definition != nullptr && loggedOnUser != nullptr);
- const OUString kReadOnlyViewService("com.sun.star.configuration.ConfigurationAccess") ;
- const OUString kComponent("org.openoffice.LDAP/UserDirectory");
- const OUString kServerDefinition("ServerDefinition");
- const OUString kServer("Server");
- const OUString kPort("Port");
- const OUString kBaseDN("BaseDN");
- const OUString kUser("SearchUser");
- const OUString kPassword("SearchPassword");
- const OUString kUserObjectClass("UserObjectClass");
- const OUString kUserUniqueAttr("UserUniqueAttribute");
uno::Reference< XInterface > xIface;
try
@@ -104,35 +94,35 @@ bool LdapUserProfileBe::readLdapConfiguration(
uno::Reference< lang::XMultiServiceFactory > xCfgProvider(
css::configuration::theDefaultProvider::get(context));
- css::beans::NamedValue aPath("nodepath", uno::makeAny(kComponent) );
+ css::beans::NamedValue aPath("nodepath", uno::makeAny(OUString("org.openoffice.LDAP/UserDirectory")) );
uno::Sequence< uno::Any > aArgs(1);
aArgs[0] <<= aPath;
- xIface = xCfgProvider->createInstanceWithArguments(kReadOnlyViewService, aArgs);
+ xIface = xCfgProvider->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", aArgs);
uno::Reference<container::XNameAccess > xAccess(xIface, uno::UNO_QUERY_THROW);
- xAccess->getByName(kServerDefinition) >>= xIface;
+ xAccess->getByName("ServerDefinition") >>= xIface;
uno::Reference<container::XNameAccess > xChildAccess(xIface, uno::UNO_QUERY_THROW);
- if (!getLdapStringParam(xChildAccess, kServer, definition->mServer))
+ if (!getLdapStringParam(xChildAccess, "Server", definition->mServer))
return false;
- if (!getLdapStringParam(xChildAccess, kBaseDN, definition->mBaseDN))
+ if (!getLdapStringParam(xChildAccess, "BaseDN", definition->mBaseDN))
return false;
definition->mPort=0;
- xChildAccess->getByName(kPort) >>= definition->mPort ;
+ xChildAccess->getByName("Port") >>= definition->mPort ;
if (definition->mPort == 0)
return false;
- if (!getLdapStringParam(xAccess, kUserObjectClass, definition->mUserObjectClass))
+ if (!getLdapStringParam(xAccess, "UserObjectClass", definition->mUserObjectClass))
return false;
- if (!getLdapStringParam(xAccess, kUserUniqueAttr, definition->mUserUniqueAttr))
+ if (!getLdapStringParam(xAccess, "UserUniqueAttribute", definition->mUserUniqueAttr))
return false;
- getLdapStringParam(xAccess, kUser, definition->mAnonUser);
- getLdapStringParam(xAccess, kPassword, definition->mAnonCredentials);
+ getLdapStringParam(xAccess, "SearchUser", definition->mAnonUser);
+ getLdapStringParam(xAccess, "SearchPassword", definition->mAnonCredentials);
}
catch (const uno::Exception&)
{