X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fldapauthenticator.h;h=a1498065e720c22ccc32f5b07f85b3533f53ad41;hp=3b7c2aae4b99a7191c096198e75c553e8c014ec3;hb=f77a0b720ed58a2b68876b9320742b81b6df871f;hpb=931e5280abc6738f94ac052af2a7e31e82487cf1 diff --git a/src/core/ldapauthenticator.h b/src/core/ldapauthenticator.h index 3b7c2aae..a1498065 100644 --- a/src/core/ldapauthenticator.h +++ b/src/core/ldapauthenticator.h @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2005-2015 by the Quassel Project * + * Copyright (C) 2005-2016 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -20,21 +20,27 @@ /* This file contains an implementation of an LDAP Authenticator, as an example * of what a custom external auth provider could do. - * + * * It's based off of this pull request for quassel by abustany: * https://github.com/quassel/quassel/pull/4/ - * + * */ -#ifndef LDAPAUTHENTICATOR_H -#define LDAPAUTHENTICATOR_H +#pragma once #include "authenticator.h" #include "core.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 // Default LDAP server port. #define DEFAULT_LDAP_PORT 389 @@ -50,15 +56,17 @@ public: public slots: /* General */ bool isAvailable() const; - QString displayName() const; + QString backendId() const; QString description() const; virtual QStringList setupKeys() const; virtual QVariantMap setupDefaults() const; - + + virtual inline bool canChangePassword() const { return false; } + bool setup(const QVariantMap &settings = QVariantMap()); State init(const QVariantMap &settings = QVariantMap()); UserId validateUser(const QString &user, const QString &password); - + protected: virtual void setConnectionProperties(const QVariantMap &properties); bool ldapConnect(); @@ -76,14 +84,11 @@ private: int _port; QString _bindDN; QString _baseDN; - QString _filter; + QString _filter; QString _bindPassword; QString _uidAttribute; - // The actual connection object. - LDAP *_connection; - -}; - + // The actual connection object. + LDAP *_connection; -#endif +};