summaryrefslogtreecommitdiffstats
path: root/src/ldapcontroller.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-06-11 15:34:51 -0500
committerTimothy Pearson <[email protected]>2012-06-11 15:34:51 -0500
commite2d9b461c364c36b12c713b20658ab9444587d43 (patch)
tree4b03ba42db37fe1443f3bf23593de1bb47478d50 /src/ldapcontroller.cpp
parenta74f58160a68cc658f32037cb4e9a06391759bd6 (diff)
downloadkcmldapcontroller-e2d9b461c364c36b12c713b20658ab9444587d43.tar.gz
kcmldapcontroller-e2d9b461c364c36b12c713b20658ab9444587d43.zip
Add skeleton secondary realm wizard
Diffstat (limited to 'src/ldapcontroller.cpp')
-rw-r--r--src/ldapcontroller.cpp57
1 files changed, 42 insertions, 15 deletions
diff --git a/src/ldapcontroller.cpp b/src/ldapcontroller.cpp
index 2e93f11..8340902 100644
--- a/src/ldapcontroller.cpp
+++ b/src/ldapcontroller.cpp
@@ -51,7 +51,8 @@
#include "sha1.h"
#include "ldapcontroller.h"
-#include "primaryrealmwizard/realmwizard.h"
+#include "primaryrealmwizard/primaryrealmwizard.h"
+#include "secondaryrealmwizard/secondaryrealmwizard.h"
#include "processingdialog.h"
#include "ldapcontrollerconfigbase.h"
@@ -146,32 +147,32 @@ LDAPController::~LDAPController() {
void LDAPController::systemRoleChanged() {
if (m_base->systemRole->currentItem() != m_prevRole) {
- if (m_base->systemRole->currentItem() == ROLE_PRIMARY_REALM_CONTROLLER) {
- // Verify that this workstation was not already bonded to an LDAP realm!
- bool bonded = false;
- TQStringList cfgRealms = m_systemconfig->groupList();
- for (TQStringList::Iterator it(cfgRealms.begin()); it != cfgRealms.end(); ++it) {
- if ((*it).startsWith("LDAPRealm-")) {
- m_systemconfig->setGroup(*it);
- if (m_systemconfig->readBoolEntry("bonded", false) == true) {
- bonded = true;
- }
+ // Verify that this workstation was not already bonded to an LDAP realm!
+ bool bonded = false;
+ TQStringList cfgRealms = m_systemconfig->groupList();
+ for (TQStringList::Iterator it(cfgRealms.begin()); it != cfgRealms.end(); ++it) {
+ if ((*it).startsWith("LDAPRealm-")) {
+ m_systemconfig->setGroup(*it);
+ if (m_systemconfig->readBoolEntry("bonded", false) == true) {
+ bonded = true;
}
}
-
+ }
+
+ if (m_base->systemRole->currentItem() == ROLE_PRIMARY_REALM_CONTROLLER) {
if (bonded) {
KMessageBox::error(0, i18n("<qt>You are already bonded to a realm!<p>Please unbond from all realms before selecting a Realm Controller role</qt>"), i18n("Common Sense Failure"));
- m_base->systemRole->setCurrentItem(0);
+ m_base->systemRole->setCurrentItem(m_prevRole);
}
else {
// Something will probably change
save();
- RealmWizard realmwizard(this, m_fqdn, m_certconfig, this);
+ PrimaryRealmWizard realmwizard(this, m_fqdn, m_certconfig, this);
if (realmwizard.exec() < 0) {
// Wizard was cancelled
// Back out all changes!
- m_base->systemRole->setCurrentItem(ROLE_WORKSTATION);
+ m_base->systemRole->setCurrentItem(m_prevRole);
save();
}
else {
@@ -185,8 +186,34 @@ void LDAPController::systemRoleChanged() {
}
else if (m_base->systemRole->currentItem() == ROLE_SECONDARY_REALM_CONTROLLER) {
// RAJA FIXME
+#if 0
KMessageBox::error(0, i18n("<qt>Secondary realm controller support is not yet available<p>If you want to see it implemented, contact the Trinity Desktop developers</qt>"), i18n("Feature Not Yet Available"));
m_base->systemRole->setCurrentItem(m_prevRole);
+#else
+ if (bonded) {
+ KMessageBox::error(0, i18n("<qt>You are already bonded to a realm!<p>Please unbond from all realms before selecting a Realm Controller role</qt>"), i18n("Common Sense Failure"));
+ m_base->systemRole->setCurrentItem(m_prevRole);
+ }
+ else {
+ // Something will probably change
+ save();
+
+ SecondaryRealmWizard realmwizard(this, m_fqdn, m_certconfig, this);
+ if (realmwizard.exec() < 0) {
+ // Wizard was cancelled
+ // Back out all changes!
+ m_base->systemRole->setCurrentItem(m_prevRole);
+ save();
+ }
+ else {
+ // Wizard completed; commit changes
+ save();
+ }
+
+ // Something probably changed
+ load();
+ }
+#endif
}
else if (m_base->systemRole->currentItem() == ROLE_WORKSTATION) {
if (KMessageBox::warningYesNo(this, i18n("<qt><b>WARNING</b><br>You are attempting to demote a realm controller<p>This action will <b>PERMANENTLY DESTROY</b> the realm directory stored on this machine<p>If you do not want to do this, select <b>Cancel</b> below</qt>"), i18n("Are you absolutely sure?"), TQString("Continue"), TQString("Cancel")) == KMessageBox::Yes) {