summaryrefslogtreecommitdiffstats
path: root/tdm/kfrontend/kgreeter.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-04-29 10:45:28 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-05-02 12:19:09 +0900
commit8b79083f967ee6de83a04c02a40d6c20d9a980d4 (patch)
tree82ccdc1150984858a5355e42508c760dd25c4d1a /tdm/kfrontend/kgreeter.cpp
parentdcce5a276f9d10310f4724d902dd883a933788ac (diff)
downloadtdebase-8b79083f967ee6de83a04c02a40d6c20d9a980d4.tar.gz
tdebase-8b79083f967ee6de83a04c02a40d6c20d9a980d4.zip
Fixed FTBFS when building tdelibs/tdebase without tdehw.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'tdm/kfrontend/kgreeter.cpp')
-rw-r--r--tdm/kfrontend/kgreeter.cpp20
1 files changed, 14 insertions, 6 deletions
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp
index cd61aa857..27905e61d 100644
--- a/tdm/kfrontend/kgreeter.cpp
+++ b/tdm/kfrontend/kgreeter.cpp
@@ -35,10 +35,11 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include <dmctl.h>
+#ifdef __TDE_HAVE_TDEHWLIB
#include <ksslcertificate.h>
-
#include <tdehardwaredevices.h>
#include <tdecryptographiccarddevice.h>
+#endif
#include <tdeapplication.h>
#include <tdelocale.h>
@@ -246,6 +247,7 @@ KGreeter::~KGreeter()
void KGreeter::cryptographicCardWatcherSetup() {
cardLoginUser = TQString::null;
+#ifdef __TDE_HAVE_TDEHWLIB
// Initialize SmartCard readers
TDEGenericDevice *hwdevice;
TDEHardwareDevices *hwdevices = TDEGlobal::hardwareDevices();
@@ -256,6 +258,7 @@ void KGreeter::cryptographicCardWatcherSetup() {
connect(cdevice, TQT_SIGNAL(cardRemoved(TDECryptographicCardDevice*)), this, TQT_SLOT(cryptographicCardRemoved(TDECryptographicCardDevice*)));
cdevice->enableCardMonitoring(true);
}
+#endif
}
void KGreeter::done(int r) {
@@ -858,7 +861,11 @@ KGreeter::verifySetUser( const TQString &user )
}
void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
-#ifdef HAVE_KRB5
+#ifdef __TDE_HAVE_TDEHWLIB
+#ifndef HAVE_KRB5
+ // Don't enable card-based logins if Kerberos integration was disabled
+ return;
+#endif
// Make sure card logins are enabled before attempting one
KSimpleConfig *systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
systemconfig->setGroup(NULL);
@@ -868,10 +875,6 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
{
return;
}
-#else
- // Don't enable card-based logins if Kerberos integration was disabled
- return;
-#endif
TQString login_name = TQString::null;
X509CertificatePtrList certList = cdevice->cardX509Certificates();
@@ -938,9 +941,11 @@ void KGreeter::cryptographicCardInserted(TDECryptographicCardDevice* cdevice) {
verify->accept();
}
}
+#endif
}
void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) {
+#ifdef __TDE_HAVE_TDEHWLIB
cardLoginUser = TQString::null;
userView->setEnabled(false);
verify->lockUserEntry(false);
@@ -952,6 +957,7 @@ void KGreeter::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) {
verify->cardLoginInProgress = false;
verify->cardLoginDevice = NULL;
+#endif
}
KStdGreeter::KStdGreeter()
@@ -1332,9 +1338,11 @@ KThemedGreeter::updateStatus( bool fail, bool caps, int timedleft )
}
}
+#ifdef __TDE_HAVE_TDEHWLIB
if (cardLoginUser != TQString::null) {
verify->setPasswordPrompt(i18n("PIN:"));
}
+#endif
}
void