From ebe1ee0677547ebef722ef0523cc8ef1e0601657 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 31 May 2012 16:11:41 -0500 Subject: Add GUI elements to wizard --- src/ldapcontroller.cpp | 39 ++++- src/realmconfigpagedlg.ui | 395 +++++++++++++++++++++++++++++++++------------- src/realmfinishpagedlg.ui | 246 ++++++++++++++++------------- src/realmintropagedlg.ui | 6 +- src/realmwizard.cpp | 6 +- src/realmwizard.h | 5 +- 6 files changed, 465 insertions(+), 232 deletions(-) diff --git a/src/ldapcontroller.cpp b/src/ldapcontroller.cpp index 88fc9a4..a774263 100644 --- a/src/ldapcontroller.cpp +++ b/src/ldapcontroller.cpp @@ -38,6 +38,7 @@ #include #include "ldapcontroller.h" +#include "realmwizard.h" // FIXME // Connect this to CMake/Automake @@ -111,8 +112,19 @@ void LDAPController::systemRoleChanged() { m_base->systemRole->setCurrentItem(0); } else { - // RAJA FIXME - changed(); + // Something will probably change + save(); + + RealmWizard realmwizard(this, this); + if (realmwizard.exec() < 0) { + // Wizard was cancelled + // Back out all changes! + m_base->systemRole->setCurrentItem(ROLE_WORKSTATION); + save(); + } + + // Something probably changed + load(); } } if (m_base->systemRole->currentItem() == ROLE_WORKSTATION) { @@ -131,7 +143,7 @@ void LDAPController::load() { m_systemconfig->setGroup(NULL); m_base->systemEnableSupport->setChecked(m_systemconfig->readBoolEntry("EnableLDAP", false)); TQString ldapRole = m_systemconfig->readEntry("LDAPRole", "Workstation"); - if (ldapRole == "RealmController") { + if (ldapRole == "Realm Controller") { m_base->systemRole->setCurrentItem(ROLE_REALM_CONTROLLER); } else { @@ -145,7 +157,26 @@ void LDAPController::defaults() { } void LDAPController::save() { - // + m_systemconfig->setGroup(NULL); + m_systemconfig->writeEntry("EnableLDAP", m_base->systemEnableSupport->isChecked()); + m_systemconfig->writeEntry("LDAPRole", m_base->systemRole->currentText()); + + m_systemconfig->sync(); + + if (m_base->systemEnableSupport->isChecked()) { +// // Write the Kerberos5 configuration file +// writeKrb5ConfFile(); +// // Write the LDAP configuration file +// writeLDAPConfFile(); +// // Write the NSSwitch configuration file +// writeNSSwitchFile(); +// // Write the PAM configuration files +// writePAMFiles(); +// // Write the cron files +// writeCronFiles(); + } + + load(); } int LDAPController::buttons() { diff --git a/src/realmconfigpagedlg.ui b/src/realmconfigpagedlg.ui index 446ebdf..1661407 100644 --- a/src/realmconfigpagedlg.ui +++ b/src/realmconfigpagedlg.ui @@ -1,118 +1,293 @@ -RealmConfigPageDlg - - - RealmConfigPageDlg - - - - 0 - 0 - 678 - 452 - - - + RealmConfigPageDlg + - unnamed + RealmConfigPageDlg - - - px_introSidebar - - - - 0 - 0 - 0 - 0 - - - - - 170 - 430 - - - - Panel - - - Sunken - - - true - - - 0 - - - - - txt_welcome - - - <h3>Welcome to the TDE LDAP Realming Wizard!</h3> - - - - - TextLabel6 - - - - 1 - 1 - 0 - 0 - - - - <p>This Wizard will help you bond your machine to an LDAP realm in three quick, easy steps.</p> - <p>Please note that you will need administrative access to the LDAP realm you will be bonding with.</p> - <p>If you wish to quit the Wizard, click <b>Cancel</b> at any time.</p> - - - RichText - - - WordBreak|AlignTop|AlignLeft - - - - - - - + + + 0 + 0 + 678 + 452 + + + - Spacer6 - - - Vertical - - - Fixed - - - - 20 - 30 - + unnamed + + + px_introSidebar + + + + 0 + 0 + 0 + 0 + + + + + 170 + 430 + + + + Panel + + + Sunken + + + true + + + 0 + + + + + groupRealmInfo + + + Basic Realm Information (required) + + + + unnamed + + + + unnamed + + + Realm Name + + + + + txtRealmName + + + + + unnamed + + + Key Distribution Server [KDC] + + + + + txtKDC + + + + + unnamed + + + port + + + + + txtKDCPort + + + 1 + + + 99999 + + + + + unnamed + + + Administration Server + + + + + txtAdminServer + + + + + unnamed + + + port + + + + + txtAdminServerPort + + + 1 + + + 99999 + + + + + labelUIDOffset + + + UID offset + + + true + + + + + txtUIDOffset + + + 100 + + + 99999 + + + true + + + + + labelGIDOffset + + + GID offset + + + true + + + + + txtGIDOffset + + + 100 + + + 99999 + + + true + + + + + + + groupDomainAliases + + + Realm Domain Aliases (optional) + + + + unnamed + + + + unnamed + + + Enter each domain alias on a new line below + + + + + txtDomains + + + + + + + groupAdvancedPKInit + + + Advanced PKInit Settings (optional) + + + + unnamed + + + + checkRequireEKU + + + Require EKU + + + + + checkRequireKrbtgtOtherName + + + Require KRB TGT Other Name + + + + + checkWin2k + + + Windows 2000 Compatibility + + + + + checkWin2kPkinitRequireBinding + + + Require Windows 2000 Binding + + + + + + + Spacer6 + + + Vertical + + + Fixed + + + + 20 + 30 + + - - Spacer5 - - - Vertical - - - Expanding - - - - - - + + Spacer5 + + + Vertical + + + Expanding + + + + + + diff --git a/src/realmfinishpagedlg.ui b/src/realmfinishpagedlg.ui index a5604c8..121e632 100644 --- a/src/realmfinishpagedlg.ui +++ b/src/realmfinishpagedlg.ui @@ -1,118 +1,142 @@ -RealmFinishPageDlg - - - RealmFinishPageDlg - - - - 0 - 0 - 678 - 452 - - - + RealmFinishPageDlg + - unnamed + RealmFinishPageDlg - + - px_introSidebar - - - - 0 - 0 - 0 - 0 - - - - - 170 - 430 - - - - Panel - - - Sunken - - - true - - - 0 - - - - - txt_welcome - - - <h3>Welcome to the TDE LDAP Realming Wizard!</h3> - - - - - TextLabel6 - - - - 1 - 1 - 0 - 0 - - - - <p>This Wizard will help you bond your machine to an LDAP realm in three quick, easy steps.</p> - <p>Please note that you will need administrative access to the LDAP realm you will be bonding with.</p> - <p>If you wish to quit the Wizard, click <b>Cancel</b> at any time.</p> - - - RichText - - - WordBreak|AlignTop|AlignLeft - - - - - - - - - Spacer6 - - - Vertical - - - Fixed - - - - 20 - 30 - - + unnamed + + + + px_introSidebar + + + + 0 + 0 + 0 + 0 + + + + + 170 + 430 + + + + Panel + + + Sunken + + + true + + + 0 + + + + + yad_string + + + <h3>You're almost done!</h3> + + + + + passprompt + + + Please provide new LDAP realm administrator credentials below to finish setup + + + + + unnamed + + + Username + + + + + ldapAdminUsername + + + + + unnamed + + + Password + + + + + ldapAdminPassword + + + + + unnamed + + + Confirm Password + + + + + ldapConfirmAdminPassword + + + + + unnamed + + + LDAP Realm + + + + + ldapAdminRealm + + + + + Spacer6 + + + Vertical + + + Fixed + + + + 20 + 30 + + - - Spacer5 - - - Vertical - - - Expanding - - - - - - + + Spacer5 + + + Vertical + + + Expanding + + + + + + diff --git a/src/realmintropagedlg.ui b/src/realmintropagedlg.ui index fca7ead..651dd07 100644 --- a/src/realmintropagedlg.ui +++ b/src/realmintropagedlg.ui @@ -52,7 +52,7 @@ txt_welcome - <h3>Welcome to the TDE LDAP Realming Wizard!</h3> + <h3>Welcome to the TDE LDAP Realm Setup Wizard!</h3> @@ -68,8 +68,8 @@ - <p>This Wizard will help you bond your machine to an LDAP realm in three quick, easy steps.</p> - <p>Please note that you will need administrative access to the LDAP realm you will be bonding with.</p> + <p>This Wizard will help you create a new LDAP realm in three quick, easy steps.</p> + <p>Please note that this Wizard will overwrite any existing LDAP realms and data.</p> <p>If you wish to quit the Wizard, click <b>Cancel</b> at any time.</p> diff --git a/src/realmwizard.cpp b/src/realmwizard.cpp index e60b778..9ca02d0 100644 --- a/src/realmwizard.cpp +++ b/src/realmwizard.cpp @@ -55,8 +55,8 @@ #include "realmwizard.h" #include "realmwizard.moc" -RealmWizard::RealmWizard(TQWidget *parent, const char *name) - : KWizard(parent, name, true) { +RealmWizard::RealmWizard(LDAPController* controller, TQWidget *parent, const char *name) + : KWizard(parent, name, true), m_controller(controller) { setCaption(i18n("LDAP Realm Wizard")); @@ -152,7 +152,7 @@ bool RealmWizard::askClose(){ */ void RealmWizard::reject(){ if (askClose()){ - done(0); + done(-1); } } diff --git a/src/realmwizard.h b/src/realmwizard.h index 3c0727f..111019f 100644 --- a/src/realmwizard.h +++ b/src/realmwizard.h @@ -28,6 +28,8 @@ #include #include +#include "ldapcontroller.h" + /** prototypes */ class KLanguageCombo; class RealmIntroPage; @@ -39,7 +41,7 @@ class RealmWizard : public KWizard { Q_OBJECT public: /** construtor */ - RealmWizard(TQWidget* parent=0, const char *name=0); + RealmWizard(LDAPController* controller, TQWidget* parent=0, const char *name=0); /** destructor */ ~RealmWizard(); @@ -69,6 +71,7 @@ private: RealmConfigPage* realmpage; RealmFinishPage* finishpage; bool realm_dirty; + LDAPController* m_controller; protected: // Protected methods // the close button on the titlebar sets e->accept() which we don't want. -- cgit v1.2.1