Fix card unlock

pull/2/head
Timothy Pearson 9 years ago
parent 6f5e7b2110
commit a2af4533d3

@ -82,7 +82,8 @@ PasswordDlg::PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin)
mCapsLocked(-1), mCapsLocked(-1),
mUnlockingFailed(false), mUnlockingFailed(false),
validUserCardInserted(false), validUserCardInserted(false),
showInfoMessages(true) showInfoMessages(true),
mCardLoginInProgress(false)
{ {
init(plugin); init(plugin);
} }
@ -96,7 +97,8 @@ PasswordDlg::PasswordDlg(LockProcess *parent, GreeterPluginHandle *plugin, TQDat
mPlugin( plugin ), mPlugin( plugin ),
mCapsLocked(-1), mCapsLocked(-1),
mUnlockingFailed(false), mUnlockingFailed(false),
showInfoMessages(true) showInfoMessages(true),
mCardLoginInProgress(false)
{ {
m_lockStartDT = lockStartDateTime; m_lockStartDT = lockStartDateTime;
init(plugin); init(plugin);
@ -953,6 +955,11 @@ void PasswordDlg::capsLocked()
} }
void PasswordDlg::attemptCardLogin() { void PasswordDlg::attemptCardLogin() {
if (mCardLoginInProgress) {
return;
}
mCardLoginInProgress = true;
// FIXME // FIXME
// pam_pkcs11 is extremely chatty with no apparent way to disable the unwanted messages // pam_pkcs11 is extremely chatty with no apparent way to disable the unwanted messages
greet->setInfoMessageDisplay(false); greet->setInfoMessageDisplay(false);
@ -965,12 +972,13 @@ void PasswordDlg::attemptCardLogin() {
setFixedSize(sizeHint()); setFixedSize(sizeHint());
// Attempt authentication if configured // Attempt authentication if configured
TDECryptographicCardDevice* cdevice = static_cast< LockProcess* >(parent())->cryptographicCardDevice(); TDECryptographicCardDevice* cdevice = static_cast<LockProcess*>(parent())->cryptographicCardDevice();
if (cdevice) { if (cdevice) {
TQString autoPIN = cdevice->autoPIN(); TQString autoPIN = cdevice->autoPIN();
if (autoPIN != TQString::null) { if (autoPIN != TQString::null) {
greet->start();
greet->setPassword(autoPIN); greet->setPassword(autoPIN);
greet->next(); TQTimer::singleShot(0, this, SLOT(slotOK()));
} }
} }
} }
@ -987,6 +995,8 @@ void PasswordDlg::resetCardLogin() {
// Restore information message display settings // Restore information message display settings
greet->setInfoMessageDisplay(showInfoMessages); greet->setInfoMessageDisplay(showInfoMessages);
mCardLoginInProgress = false;
} }
#include "lockdlg.moc" #include "lockdlg.moc"

@ -100,6 +100,7 @@ class PasswordDlg : public TQDialog, public KGreeterPluginHandler
TQStringList::iterator currLayout; TQStringList::iterator currLayout;
int sPid, sFd; int sPid, sFd;
TQListView *lv; TQListView *lv;
bool mCardLoginInProgress;
TQDateTime m_lockStartDT; TQDateTime m_lockStartDT;
}; };

Loading…
Cancel
Save