summaryrefslogtreecommitdiff
path: root/liblightdm-qt/greeter.cpp
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2011-07-22 09:27:35 +1000
committerRobert Ancell <robert.ancell@canonical.com>2011-07-22 09:27:35 +1000
commit92b80b95a6c4224f16f694596864ba832df692cf (patch)
tree00c638074655bf44b61f01055730304737e71ef8 /liblightdm-qt/greeter.cpp
parent1695715a76c4b7d0e1c7746e5c852750407e9df3 (diff)
downloadlightdm-git-92b80b95a6c4224f16f694596864ba832df692cf.tar.gz
Pass the username back from the daeamon so can tell who logged in as when using login prompt
Diffstat (limited to 'liblightdm-qt/greeter.cpp')
-rw-r--r--liblightdm-qt/greeter.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/liblightdm-qt/greeter.cpp b/liblightdm-qt/greeter.cpp
index 6b4ca2e7..da8651c8 100644
--- a/liblightdm-qt/greeter.cpp
+++ b/liblightdm-qt/greeter.cpp
@@ -380,6 +380,9 @@ void Greeter::onRead(int fd)
{
case SERVER_MESSAGE_PROMPT_AUTHENTICATION:
sequenceNumber = readInt(message, messageLength, &offset);
+ username = readString(message, messageLength, &offset);
+
+ d->authenticationUser = username;
if (sequenceNumber == d->authenticateSequenceNumber &&
!d->cancellingAuthentication)
@@ -412,16 +415,16 @@ void Greeter::onRead(int fd)
break;
case SERVER_MESSAGE_END_AUTHENTICATION:
sequenceNumber = readInt(message, messageLength, &offset);
+ username = readString(message, messageLength, &offset);
returnCode = readInt(message, messageLength, &offset);
if (sequenceNumber == d->authenticateSequenceNumber)
{
qDebug() << "Authentication complete with return code " << returnCode;
+
d->cancellingAuthentication = false;
d->isAuthenticated = (returnCode == 0);
- if(!d->isAuthenticated) {
- d->authenticationUser = "";
- }
+ d->authenticationUser = username;
emit authenticationComplete();
d->inAuthentication = false;
}