X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fcore%2Fldapauthenticator.h;h=1b0b63948e26f2c98bab13537914e5698295d866;hp=ff05c4f3f44829c15966bb949aaa9db07155ab08;hb=5fc6f7e2d63b45770574260afd6ce535e9548d23;hpb=258d157a228d2b2b46b01d3b33ab932b9979436a diff --git a/src/core/ldapauthenticator.h b/src/core/ldapauthenticator.h index ff05c4f3..1b0b6394 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-2018 by the Quassel Project * * devel@quassel-irc.org * * * * This program is free software; you can redistribute it and/or modify * @@ -26,8 +26,7 @@ * */ -#ifndef LDAPAUTHENTICATOR_H -#define LDAPAUTHENTICATOR_H +#pragma once #include "authenticator.h" @@ -44,7 +43,7 @@ //#endif // Default LDAP server port. -#define DEFAULT_LDAP_PORT 389 +constexpr int DEFAULT_LDAP_PORT = 389; class LdapAuthenticator : public Authenticator { @@ -52,33 +51,36 @@ class LdapAuthenticator : public Authenticator public: LdapAuthenticator(QObject *parent = 0); - virtual ~LdapAuthenticator(); + ~LdapAuthenticator() override; public slots: /* General */ - bool isAvailable() const; - QString backendId() const; - QString description() const; - virtual QStringList setupKeys() const; - virtual QVariantMap setupDefaults() const; + bool isAvailable() const override; + QString backendId() const override; + QString displayName() const override; + QString description() const override; + QVariantList setupData() const override; - virtual inline bool canChangePassword() const { return false; } + bool canChangePassword() const override { return false; } - bool setup(const QVariantMap &settings = QVariantMap()); - State init(const QVariantMap &settings = QVariantMap()); - UserId validateUser(const QString &user, const QString &password); + bool setup(const QVariantMap &settings, const QProcessEnvironment &environment, + bool loadFromEnvironment) override; + State init(const QVariantMap &settings, const QProcessEnvironment &environment, + bool loadFromEnvironment) override; + UserId validateUser(const QString &user, const QString &password) override; protected: - virtual void setConnectionProperties(const QVariantMap &properties); + void setAuthProperties(const QVariantMap &properties, const QProcessEnvironment &environment, + bool loadFromEnvironment); bool ldapConnect(); void ldapDisconnect(); bool ldapAuth(const QString &username, const QString &password); // Protected methods for retrieving info about the LDAP connection. - inline virtual QString hostName() { return _hostName; } - inline virtual int port() { return _port; } - inline virtual QString bindDN() { return _bindDN; } - inline virtual QString baseDN() { return _baseDN; } + QString hostName() const { return _hostName; } + int port() const { return _port; } + QString bindDN() const { return _bindDN; } + QString baseDN() const { return _baseDN; } private: QString _hostName; @@ -90,9 +92,5 @@ private: QString _uidAttribute; // The actual connection object. - LDAP *_connection; - + LDAP *_connection {nullptr}; }; - - -#endif