summaryrefslogtreecommitdiffstats
path: root/tdm/kfrontend
diff options
context:
space:
mode:
Diffstat (limited to 'tdm/kfrontend')
-rw-r--r--tdm/kfrontend/kgreeter.cpp19
-rw-r--r--tdm/kfrontend/kgverify.cpp12
-rw-r--r--tdm/kfrontend/kgverify.h1
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;