X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fcore%2Fldapauthenticator.cpp;h=5b62b89bd8b19d27c8d718ae143b4607f3bdd9f3;hb=07473582d22eddd934ee52127cad2baa11943d59;hp=378fc4bba1751d5d92236fabde8124dafdec74c7;hpb=d6f3eedebc7f9619b04dffc5f48faa792950fdcd;p=quassel.git diff --git a/src/core/ldapauthenticator.cpp b/src/core/ldapauthenticator.cpp index 378fc4bb..5b62b89b 100644 --- a/src/core/ldapauthenticator.cpp +++ b/src/core/ldapauthenticator.cpp @@ -32,8 +32,14 @@ #include "network.h" #include "quassel.h" -// Link against LDAP. +/* We should use openldap on windows if at all possible, rather than trying to + * write some kind of compatiblity routine. +#ifdef Q_CC_MSVC +#include +#include +#else*/ #include +//#endif LdapAuthenticator::LdapAuthenticator(QObject *parent) : Authenticator(parent), @@ -118,11 +124,17 @@ UserId LdapAuthenticator::validateUser(const QString &username, const QString &p // 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 usernames. + // 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()); if (!quasselID.isValid()) { - return Core::addUser(username, QString()); + return Core::addUser(username, QString(), displayName()); + } + else if (!(Core::checkAuthProvider(quasselID, displayName()))) + { + return 0; } return quasselID; }