X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fldapauthenticator.cpp;h=34768faaec601d574473094beac44d78f0cae345;hp=227df19dd3dc2837b83c44bb9bce45653d2a603e;hb=cfbd4daee17dbb3c4052d938bf33edd08711d728;hpb=46f20e19a343ad0fa17dde6c32f17e60fc682c9b diff --git a/src/core/ldapauthenticator.cpp b/src/core/ldapauthenticator.cpp index 227df19d..34768faa 100644 --- a/src/core/ldapauthenticator.cpp +++ b/src/core/ldapauthenticator.cpp @@ -83,28 +83,20 @@ QString LdapAuthenticator::description() const return tr("Authenticate users using an LDAP server."); } -QStringList LdapAuthenticator::setupKeys() const -{ - // The parameters needed for LDAP. - QStringList keys; - keys << "Hostname" - << "Port" - << "Bind DN" - << "Bind Password" - << "Base DN" - << "Filter" - << "UID Attribute"; - return keys; -} - -QVariantMap LdapAuthenticator::setupDefaults() const +QVariantList LdapAuthenticator::setupData() const { - QVariantMap map; - map["Hostname"] = QVariant(QString("ldap://localhost")); - map["Port"] = QVariant(DEFAULT_LDAP_PORT); - map["UID Attribute"] = QVariant(QString("uid")); - return map; + // The parameters needed for LDAP. + QVariantList data; + data << "Hostname" << tr("Hostname") << QString{"ldap://localhost"} + << "Port" << tr("Port") << DEFAULT_LDAP_PORT + << "BindDN" << tr("Bind DN") << QString{} + << "BindPassword" << tr("Bind Password") << QString{} + << "BaseDN" << tr("Base DN") << QString{} + << "Filter" << tr("Filter") << QString{} + << "UidAttribute" << tr("UID Attribute") << QString{"uid"} + ; + return data; } @@ -112,11 +104,11 @@ void LdapAuthenticator::setAuthProperties(const QVariantMap &properties) { _hostName = properties["Hostname"].toString(); _port = properties["Port"].toInt(); - _baseDN = properties["Base DN"].toString(); + _bindDN = properties["BindDN"].toString(); + _bindPassword = properties["BindPassword"].toString(); + _baseDN = properties["BaseDN"].toString(); _filter = properties["Filter"].toString(); - _bindDN = properties["Bind DN"].toString(); - _bindPassword = properties["Bind Password"].toString(); - _uidAttribute = properties["UID Attribute"].toString(); + _uidAttribute = properties["UidAttribute"].toString(); } // TODO: this code is sufficiently general that in the future, perhaps an abstract @@ -160,11 +152,11 @@ Authenticator::State LdapAuthenticator::init(const QVariantMap &settings) bool status = ldapConnect(); if (!status) { - quInfo() << qPrintable(backendId()) << "Authenticator cannot connect."; + quInfo() << qPrintable(backendId()) << "authenticator cannot connect."; return NotAvailable; } - quInfo() << qPrintable(backendId()) << "Authenticator is ready."; + quInfo() << qPrintable(backendId()) << "authenticator is ready."; return IsReady; }