summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-12-12 00:43:05 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-12-12 00:43:05 -0600
commit9b5b85669027e3691b6bc335800aa8c21716024f (patch)
tree12ad1b67f156ddd5aeb4e353ce143bad1cfb8ec9
parent431b794730a8c27f05ae9d1ee7519adc1dd6c2d4 (diff)
downloadkcmldapmanager-9b5b8566.tar.gz
kcmldapmanager-9b5b8566.zip
Fix invalid DN error on startup when default realm is not set
-rw-r--r--src/ldapmgr.cpp16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/ldapmgr.cpp b/src/ldapmgr.cpp
index d152ebe..28ae1ac 100644
--- a/src/ldapmgr.cpp
+++ b/src/ldapmgr.cpp
@@ -168,7 +168,21 @@ void LDAPConfig::load() {
}
}
}
- connectToRealm(base->user_ldapRealm->currentText().upper());
+ else {
+ // Try hard not to select the "<none>" realm
+ for (i=0; i<base->user_ldapRealm->count(); i++) {
+ if (base->user_ldapRealm->text(i).lower() != "<none>") {
+ base->user_ldapRealm->setCurrentItem(i);
+ base->group_ldapRealm->setCurrentItem(i);
+ base->machine_ldapRealm->setCurrentItem(i);
+ base->service_ldapRealm->setCurrentItem(i);
+ break;
+ }
+ }
+ }
+ if (base->user_ldapRealm->currentText().lower() != "<none>") {
+ connectToRealm(base->user_ldapRealm->currentText().upper());
+ }
}
void LDAPConfig::defaults() {