X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fldapauthenticator.cpp;h=ae4ea8773518504c7377497eb81a4836bf3453fc;hp=34768faaec601d574473094beac44d78f0cae345;hb=bcaaebece13e123dc66dc32b59e13956b12f8b4c;hpb=8fd4e06a6a0ccc7d8a7ad15b492ab8311b59a0b8 diff --git a/src/core/ldapauthenticator.cpp b/src/core/ldapauthenticator.cpp index 34768faa..ae4ea877 100644 --- a/src/core/ldapauthenticator.cpp +++ b/src/core/ldapauthenticator.cpp @@ -122,14 +122,18 @@ UserId LdapAuthenticator::validateUser(const QString &username, const QString &p return UserId(); } + // LDAP is case-insensitive, thus we will lowercase the username, in spite of + // a better solution :( + const QString lUsername = username.toLower(); + // If auth succeeds, but the user has not logged into quassel previously, make // a new user for them and return that ID. // Users created via LDAP have empty passwords, but authenticator column = LDAP. // On the other hand, if auth succeeds and the user already exists, do a final // cross-check to confirm we're using the right auth provider. - UserId quasselId = Core::validateUser(username, QString()); + UserId quasselId = Core::validateUser(lUsername, QString()); if (!quasselId.isValid()) { - return Core::addUser(username, QString(), backendId()); + return Core::addUser(lUsername, QString(), backendId()); } else if (!(Core::checkAuthProvider(quasselId, backendId()))) { return 0;