diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-03-21 20:47:15 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2013-03-21 20:47:15 -0500 |
commit | 3caa3ef1be6a44a10df19ab95d01f69528667368 (patch) | |
tree | 39531b7f14bb28c2a9adb68319cce6a3294b32e0 /src/ldapbonding.cpp | |
parent | f6459b79852caa355c535d96b9a6709a8b85814f (diff) | |
download | kcmldap-3caa3ef1be6a44a10df19ab95d01f69528667368.tar.gz kcmldap-3caa3ef1be6a44a10df19ab95d01f69528667368.zip |
Fix rebonding
Diffstat (limited to 'src/ldapbonding.cpp')
-rw-r--r-- | src/ldapbonding.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/ldapbonding.cpp b/src/ldapbonding.cpp index f8b16c0..fbf1006 100644 --- a/src/ldapbonding.cpp +++ b/src/ldapbonding.cpp @@ -334,15 +334,26 @@ void LDAPConfig::reBondToRealm() { passdlg.m_base->ldapAdminRealm->setText(realmName); if (passdlg.exec() == TQDialog::Accepted) { setEnabled(false); - if (LDAPManager::bondRealm(passdlg.m_base->ldapAdminUsername->text(), passdlg.m_base->ldapAdminPassword->password(), passdlg.m_base->ldapAdminRealm->text(), &errorString) == 0) { + if (LDAPManager::unbondRealm(m_realms[realmName], passdlg.m_base->ldapAdminUsername->text(), passdlg.m_base->ldapAdminPassword->password(), passdlg.m_base->ldapAdminRealm->text(), &errorString) == 0) { // Success! - realmcfg.bonded = true; + realmcfg.bonded = false; m_realms.remove(realmName); m_realms.insert(realmName, realmcfg); save(); + + if (LDAPManager::bondRealm(passdlg.m_base->ldapAdminUsername->text(), passdlg.m_base->ldapAdminPassword->password(), passdlg.m_base->ldapAdminRealm->text(), &errorString) == 0) { + // Success! + realmcfg.bonded = true; + m_realms.remove(realmName); + m_realms.insert(realmName, realmcfg); + save(); + } + else { + KMessageBox::error(this, i18n("<qt><b>Unable to bond to realm!</b><p>Details: %1</qt>").arg(errorString), i18n("Unable to Bond to Realm")); + } } else { - KMessageBox::error(this, i18n("<qt><b>Unable to bond to realm!</b><p>Details: %1</qt>").arg(errorString), i18n("Unable to Bond to Realm")); + KMessageBox::error(this, i18n("<qt><b>Unable to unbond from realm!</b><p>%1</qt>").arg(errorString), i18n("Unable to Unbond from Realm")); } setEnabled(true); } |