From: Manuel Nickschas Date: Sun, 23 Oct 2016 23:03:16 +0000 (+0200) Subject: ldap: Don't use the backend's display name as identifier X-Git-Tag: travis-deploy-test~271 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=423e088804d243368074ab218b2bda2fff3303c9 ldap: Don't use the backend's display name as identifier We'd like to have the display name translatable, so it should not be used as an identifer. Instead, introduce a backendId property for this purpose. --- diff --git a/src/core/authenticator.h b/src/core/authenticator.h index 97091efa..3bec6f6f 100644 --- a/src/core/authenticator.h +++ b/src/core/authenticator.h @@ -52,9 +52,13 @@ public slots: */ virtual bool isAvailable() const = 0; + //! Returns the identifier of the authenticator backend + /** \return A string that can be used by the client to identify the authenticator backend */ + virtual QString backendId() const = 0; + //! Returns the display name of the authenticator backend /** \return A string that can be used by the client to name the authenticator backend */ - virtual QString backendId() const = 0; + virtual QString displayName() const = 0; //! Returns a description of this authenticator backend /** \return A string that can be displayed by the client to describe the authenticator */ diff --git a/src/core/core.cpp b/src/core/core.cpp index bb1df473..4aab673e 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -799,7 +799,8 @@ QVariantList Core::authenticatorInfo() QVariantList backends; foreach(const Authenticator *backend, instance()->_authenticators.values()) { QVariantMap v; - v["DisplayName"] = backend->backendId(); + v["BackendId"] = backend->backendId(); + v["DisplayName"] = backend->displayName(); v["Description"] = backend->description(); v["SetupKeys"] = backend->setupKeys(); v["SetupDefaults"] = backend->setupDefaults(); diff --git a/src/core/ldapauthenticator.cpp b/src/core/ldapauthenticator.cpp index b9f99227..227df19d 100644 --- a/src/core/ldapauthenticator.cpp +++ b/src/core/ldapauthenticator.cpp @@ -65,13 +65,19 @@ bool LdapAuthenticator::isAvailable() const QString LdapAuthenticator::backendId() const { - // We identify the backend to use for the monolithic core by its displayname. + // We identify the backend to use for the monolithic core by this identifier. // so only change this string if you _really_ have to and make sure the core // setup for the mono client still works ;) return QString("LDAP"); } +QString LdapAuthenticator::displayName() const +{ + return tr("LDAP"); +} + + QString LdapAuthenticator::description() const { return tr("Authenticate users using an LDAP server."); diff --git a/src/core/ldapauthenticator.h b/src/core/ldapauthenticator.h index 59a35b6b..8415496f 100644 --- a/src/core/ldapauthenticator.h +++ b/src/core/ldapauthenticator.h @@ -57,6 +57,7 @@ public slots: /* General */ bool isAvailable() const; QString backendId() const; + QString displayName() const; QString description() const; virtual QStringList setupKeys() const; virtual QVariantMap setupDefaults() const; diff --git a/src/core/sqlauthenticator.cpp b/src/core/sqlauthenticator.cpp index 4977218e..3be817b9 100644 --- a/src/core/sqlauthenticator.cpp +++ b/src/core/sqlauthenticator.cpp @@ -46,13 +46,19 @@ bool SqlAuthenticator::isAvailable() const QString SqlAuthenticator::backendId() const { - // We identify the backend to use for the monolithic core by its displayname. + // We identify the backend to use for the monolithic core by this identifier. // so only change this string if you _really_ have to and make sure the core // setup for the mono client still works ;) return QString("Database"); } +QString SqlAuthenticator::displayName() const +{ + return tr("Database"); +} + + QString SqlAuthenticator::description() const { return tr("Do not auth against any remote authentication service, but instead save a hashed and salted password " diff --git a/src/core/sqlauthenticator.h b/src/core/sqlauthenticator.h index c392045b..b5a010a9 100644 --- a/src/core/sqlauthenticator.h +++ b/src/core/sqlauthenticator.h @@ -34,6 +34,7 @@ public slots: /* General */ bool isAvailable() const; QString backendId() const; + QString displayName() const; QString description() const; virtual inline QStringList setupKeys() const { return QStringList(); } virtual inline QVariantMap setupDefaults() const { return QVariantMap(); } diff --git a/src/qtui/coreconfigwizard.cpp b/src/qtui/coreconfigwizard.cpp index 99fc3540..401fd616 100644 --- a/src/qtui/coreconfigwizard.cpp +++ b/src/qtui/coreconfigwizard.cpp @@ -40,7 +40,7 @@ CoreConfigWizard::CoreConfigWizard(CoreConnection *connection, const QList