diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-09-18 23:01:01 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2015-09-18 23:01:01 -0500 |
commit | 6f5e7b211009bf3a5b6816ee3cb064d7f393dfb9 (patch) | |
tree | e30e480a7524c15acd02901d3e6f0e48a9f6a12b /tdm | |
parent | 1ec002a8ee0c9165bedbcb6e273d9bacb0588e47 (diff) | |
download | tdebase-6f5e7b211009bf3a5b6816ee3cb064d7f393dfb9.tar.gz tdebase-6f5e7b211009bf3a5b6816ee3cb064d7f393dfb9.zip |
Streamline cryptographic card logon process
Diffstat (limited to 'tdm')
-rw-r--r-- | tdm/kfrontend/kgreeter.cpp | 19 | ||||
-rw-r--r-- | tdm/kfrontend/kgverify.cpp | 12 | ||||
-rw-r--r-- | tdm/kfrontend/kgverify.h | 1 |
3 files changed, 29 insertions, 3 deletions
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp index 15b325898..e14e58491 100644 --- a/tdm/kfrontend/kgreeter.cpp +++ b/tdm/kfrontend/kgreeter.cpp @@ -899,9 +899,16 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) { // pam_pkcs11 is extremely chatty with no apparent way to disable the unwanted messages verify->setInfoMessageDisplay(false); - // Initiate login + // Set up password prompt cardLoginUser = login_name; - verify->accept(); + verify->setPasswordPrompt(i18n("PIN:")); + + TQString autoPIN = cdevice->autoPIN(); + if (autoPIN != TQString::null) { + // Initiate login + verify->setPassword(autoPIN); + verify->accept(); + } } } } @@ -910,6 +917,7 @@ void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) { cardLoginUser = TQString::null; verify->lockUserEntry(false); verify->requestAbort(); + verify->setPasswordPrompt(TQString::null); // Restore information message display settings verify->setInfoMessageDisplay(showInfoMessages); @@ -1128,8 +1136,9 @@ KThemedGreeter::KThemedGreeter() xauth_warning = themer->findNode( "xauth-warning" ); // tdm ext pam_error = themer->findNode( "pam-error" ); timed_label = themer->findNode( "timed-label" ); - if (pam_error && pam_error->isA( "KdmLabel" )) + if (pam_error && pam_error->isA( "KdmLabel" )) { static_cast<KdmLabel*>(pam_error)->setText( i18n("Login Failed.") ); + } KdmItem *itm; if ((itm = themer->findNode( "pam-message" ))) // done via msgboxes @@ -1291,6 +1300,10 @@ KThemedGreeter::updateStatus( bool fail, bool caps, int timedleft ) timed_label->hide( true ); } } + + if (cardLoginUser != TQString::null) { + verify->setPasswordPrompt(i18n("PIN:")); + } } void diff --git a/tdm/kfrontend/kgverify.cpp b/tdm/kfrontend/kgverify.cpp index cc20d54ed..6e6b685db 100644 --- a/tdm/kfrontend/kgverify.cpp +++ b/tdm/kfrontend/kgverify.cpp @@ -295,6 +295,18 @@ KGVerify::setInfoMessageDisplay(bool on) } void +KGVerify::setPasswordPrompt(const TQString &prompt) +{ + greet->setPasswordPrompt(prompt); + if (prompt != TQString::null) { + setPassPromptText(prompt, false); + } + else { + setPassPromptText(TQString::null, true); + } +} + +void KGVerify::start() { authTok = (func == KGreeterPlugin::ChAuthTok); diff --git a/tdm/kfrontend/kgverify.h b/tdm/kfrontend/kgverify.h index 278cc0dd3..2ab3ff37b 100644 --- a/tdm/kfrontend/kgverify.h +++ b/tdm/kfrontend/kgverify.h @@ -103,6 +103,7 @@ class KGVerify : public TQObject, public KGreeterPluginHandler { void lockUserEntry( const bool lock ); void setPassword( const TQString &pass ); void setInfoMessageDisplay( bool on ); + void setPasswordPrompt(const TQString &prompt); /* virtual */ void selectPlugin( int id ); bool entitiesLocal() const; bool entitiesFielded() const; |