@@ -18,6 +18,8 @@
19#include "../Greeter.h"
19#include "../Greeter.h"
20#include "../GreeterPrivate.h"
20#include "../GreeterPrivate.h"
21+#include <QtCore/QDir>
22+#include <QtCore/QSettings>
22namespace QLightDM
24namespace QLightDM
@@ -33,13 +35,32 @@ void GreeterPrivate::handleAuthenticate()
34 Q_Q(Greeter);
36 Q_Q(Greeter);
38+ QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
39+ QVariant password = settings.value("password", "none");
41+ if (password == "pin") {
42+ Q_EMIT q->showPrompt("PIN", Greeter::PromptTypeSecret);
43+ } else if (password == "keyboard") {
44+ Q_EMIT q->showPrompt("Password", Greeter::PromptTypeSecret);
36− authenticated = true;
46+ authenticated = true;
37− Q_EMIT q->authenticationComplete();
47+ Q_EMIT q->authenticationComplete();
40void GreeterPrivate::handleRespond(const QString &response)
51void GreeterPrivate::handleRespond(const QString &response)
42− Q_UNUSED(response);
53+ Q_Q(Greeter);
55+ QSettings settings(QDir::homePath() + "/.unity8-greeter-demo", QSettings::NativeFormat);
56+ QVariant password = settings.value("password", "none");
58+ if (password == "pin") {
59+ authenticated = (response == "1234");
61+ authenticated = (response == "password");
63+ Q_EMIT q->authenticationComplete();