summaryrefslogtreecommitdiff
path: root/plugins/bluemonkey/authenticate.h
blob: df8428332841ea47d226c07e3ab59cbb6f603691 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef AUTHENTICATE_H
#define AUTHENTICATE_H

#include <QObject>
#include <QStringList>
#include <map>
#include <string>

class Authenticate : public QObject
{
    Q_OBJECT
	Q_PROPERTY(QString pin READ pin WRITE setPin)
public:
	explicit Authenticate(std::map<std::string, std::string> config, QObject *parent = 0);
	void setPin(QString p) { mPin = p; }
	QString pin() { return mPin; }


public Q_SLOTS:
	bool isAuthorized(QString prefix);
	bool authorize(QString prefix, QString pin);

private:
	QStringList authorized;
	QString mPin;
};

#endif // AUTHENTICATE_H