Implement authenticator class used for logging in users
[quassel.git] / src / core / sqlauthenticator.h
diff --git a/src/core/sqlauthenticator.h b/src/core/sqlauthenticator.h
new file mode 100644 (file)
index 0000000..1b71ee2
--- /dev/null
@@ -0,0 +1,52 @@
+/***************************************************************************
+ *   Copyright (C) 2005-2015 by the Quassel Project                        *
+ *   devel@quassel-irc.org                                                 *
+ *                                                                         *
+ *   This program is free software; you can redistribute it and/or modify  *
+ *   it under the terms of the GNU General Public License as published by  *
+ *   the Free Software Foundation; either version 2 of the License, or     *
+ *   (at your option) version 3.                                           *
+ *                                                                         *
+ *   This program is distributed in the hope that it will be useful,       *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
+ *   GNU General Public License for more details.                          *
+ *                                                                         *
+ *   You should have received a copy of the GNU General Public License     *
+ *   along with this program; if not, write to the                         *
+ *   Free Software Foundation, Inc.,                                       *
+ *   51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.         *
+ ***************************************************************************/
+
+#ifndef SQLAUTHENTICATOR_H
+#define SQLAUTHENTICATOR_H
+
+#include "authenticator.h"
+
+class SqlAuthenticator : public Authenticator
+{
+    Q_OBJECT
+
+public:
+    SqlAuthenticator(QObject *parent = 0);
+    virtual ~SqlAuthenticator();
+
+public slots:
+    /* General */
+    bool isAvailable() const;
+    QString displayName() const;
+    QString description() const;
+    virtual inline QStringList setupKeys() const { return QStringList(); }
+    virtual inline QVariantMap setupDefaults() const { return QVariantMap(); }
+
+    bool setup(const QVariantMap &settings = QVariantMap());
+    State init(const QVariantMap &settings = QVariantMap());
+    UserId validateUser(const QString &user, const QString &password);
+    
+    /* User handling */
+    //virtual UserId getUserId(const QString &username);
+
+};
+
+
+#endif