diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-31 16:11:41 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-05-31 16:11:41 -0500 |
commit | ebe1ee0677547ebef722ef0523cc8ef1e0601657 (patch) | |
tree | 69f1fe14f92ebf0d636f827bb0690d6ae4feb16a /src | |
parent | 15ed3f5aa021307cadfdd59bcf0a4f51008cb0ef (diff) | |
download | kcmldapcontroller-ebe1ee0677547ebef722ef0523cc8ef1e0601657.tar.gz kcmldapcontroller-ebe1ee0677547ebef722ef0523cc8ef1e0601657.zip |
Add GUI elements to wizard
Diffstat (limited to 'src')
-rw-r--r-- | src/ldapcontroller.cpp | 39 | ||||
-rw-r--r-- | src/realmconfigpagedlg.ui | 395 | ||||
-rw-r--r-- | src/realmfinishpagedlg.ui | 246 | ||||
-rw-r--r-- | src/realmintropagedlg.ui | 6 | ||||
-rw-r--r-- | src/realmwizard.cpp | 6 | ||||
-rw-r--r-- | 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 <tqcheckbox.h> #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 @@ <!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>RealmConfigPageDlg</class> -<widget class="TQWidget"> - <property name="name"> - <cstring>RealmConfigPageDlg</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>678</width> - <height>452</height> - </rect> - </property> - <grid> + <class>RealmConfigPageDlg</class> + <widget class="TQWidget"> <property name="name"> - <cstring>unnamed</cstring> + <cstring>RealmConfigPageDlg</cstring> </property> - <widget class="TQLabel" row="0" column="0" rowspan="9" colspan="1"> - <property name="name"> - <cstring>px_introSidebar</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>170</width> - <height>430</height> - </size> - </property> - <property name="frameShape"> - <enum>Panel</enum> - </property> - <property name="frameShadow"> - <enum>Sunken</enum> - </property> - <property name="scaledContents"> - <bool>true</bool> - </property> - <property name="indent"> - <number>0</number> - </property> - </widget> - <widget class="TQLabel" row="0" column="1"> - <property name="name"> - <cstring>txt_welcome</cstring> - </property> - <property name="text"> - <string><h3>Welcome to the TDE LDAP Realming Wizard!</h3></string> - </property> - </widget> - <widget class="TQLabel" row="1" column="1"> - <property name="name"> - <cstring>TextLabel6</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>1</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string><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></string> - </property> - <property name="textFormat"> - <enum>RichText</enum> - </property> - <property name="alignment"> - <set>WordBreak|AlignTop|AlignLeft</set> - </property> - <property name="vAlign" stdset="0"> - </property> - <property name="wordwrap" stdset="0"> - </property> - </widget> - <spacer row="2" column="1"> + <property name="geometry"> + <rect> + <x>0</x> + <y>0</y> + <width>678</width> + <height>452</height> + </rect> + </property> + <grid> <property name="name"> - <cstring>Spacer6</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Fixed</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>30</height> - </size> + <cstring>unnamed</cstring> </property> + <widget class="TQLabel" row="0" column="0" rowspan="9" colspan="1"> + <property name="name"> + <cstring>px_introSidebar</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>170</width> + <height>430</height> + </size> + </property> + <property name="frameShape"> + <enum>Panel</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="indent"> + <number>0</number> + </property> + </widget> + <widget class="TQGroupBox" row="0" column="1"> + <property name="name"> + <cstring>groupRealmInfo</cstring> + </property> + <property name="title"> + <string>Basic Realm Information (required)</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Realm Name</string> + </property> + </widget> + <widget class="KLineEdit" row="0" column="1" colspan="3"> + <property name="name"> + <cstring>txtRealmName</cstring> + </property> + </widget> + <widget class="TQLabel" row="1" column="0"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Key Distribution Server [KDC]</string> + </property> + </widget> + <widget class="KLineEdit" row="1" column="1"> + <property name="name"> + <cstring>txtKDC</cstring> + </property> + </widget> + <widget class="TQLabel" row="1" column="2"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>port</string> + </property> + </widget> + <widget class="KIntNumInput" row="1" column="3"> + <property name="name"> + <cstring>txtKDCPort</cstring> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="maxValue"> + <number>99999</number> + </property> + </widget> + <widget class="TQLabel" row="2" column="0"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Administration Server</string> + </property> + </widget> + <widget class="KLineEdit" row="2" column="1"> + <property name="name"> + <cstring>txtAdminServer</cstring> + </property> + </widget> + <widget class="TQLabel" row="2" column="2"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>port</string> + </property> + </widget> + <widget class="KIntNumInput" row="2" column="3"> + <property name="name"> + <cstring>txtAdminServerPort</cstring> + </property> + <property name="minValue"> + <number>1</number> + </property> + <property name="maxValue"> + <number>99999</number> + </property> + </widget> + <widget class="TQLabel" row="3" column="0"> + <property name="name"> + <cstring>labelUIDOffset</cstring> + </property> + <property name="text"> + <string>UID offset</string> + </property> + <property name="hidden"> + <string>true</string> + </property> + </widget> + <widget class="KIntNumInput" row="3" column="1" colspan="3"> + <property name="name"> + <cstring>txtUIDOffset</cstring> + </property> + <property name="minValue"> + <number>100</number> + </property> + <property name="maxValue"> + <number>99999</number> + </property> + <property name="hidden"> + <string>true</string> + </property> + </widget> + <widget class="TQLabel" row="4" column="0"> + <property name="name"> + <cstring>labelGIDOffset</cstring> + </property> + <property name="text"> + <string>GID offset</string> + </property> + <property name="hidden"> + <string>true</string> + </property> + </widget> + <widget class="KIntNumInput" row="4" column="1" colspan="3"> + <property name="name"> + <cstring>txtGIDOffset</cstring> + </property> + <property name="minValue"> + <number>100</number> + </property> + <property name="maxValue"> + <number>99999</number> + </property> + <property name="hidden"> + <string>true</string> + </property> + </widget> + </grid> + </widget> + <widget class="TQGroupBox" row="1" column="1"> + <property name="name"> + <cstring>groupDomainAliases</cstring> + </property> + <property name="title"> + <string>Realm Domain Aliases (optional)</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" row="0" column="0"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Enter each domain alias on a new line below</string> + </property> + </widget> + <widget class="KTextEdit" row="1" column="0"> + <property name="name"> + <cstring>txtDomains</cstring> + </property> + </widget> + </grid> + </widget> + <widget class="TQGroupBox" row="2" column="1"> + <property name="name"> + <cstring>groupAdvancedPKInit</cstring> + </property> + <property name="title"> + <string>Advanced PKInit Settings (optional)</string> + </property> + <grid> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <widget class="TQCheckBox" row="0" column="0"> + <property name="name"> + <cstring>checkRequireEKU</cstring> + </property> + <property name="text"> + <string>Require EKU</string> + </property> + </widget> + <widget class="TQCheckBox" row="0" column="1"> + <property name="name"> + <cstring>checkRequireKrbtgtOtherName</cstring> + </property> + <property name="text"> + <string>Require KRB TGT Other Name</string> + </property> + </widget> + <widget class="TQCheckBox" row="1" column="0"> + <property name="name"> + <cstring>checkWin2k</cstring> + </property> + <property name="text"> + <string>Windows 2000 Compatibility</string> + </property> + </widget> + <widget class="TQCheckBox" row="1" column="1"> + <property name="name"> + <cstring>checkWin2kPkinitRequireBinding</cstring> + </property> + <property name="text"> + <string>Require Windows 2000 Binding</string> + </property> + </widget> + </grid> + </widget> + <spacer row="3" column="1"> + <property name="name"> + <cstring>Spacer6</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Fixed</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>30</height> + </size> + </property> </spacer> <spacer row="7" column="1"> - <property name="name"> - <cstring>Spacer5</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - </spacer> - </grid> -</widget> -<layoutdefaults spacing="3" margin="6"/> -<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> + <property name="name"> + <cstring>Spacer5</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + </grid> + </widget> + <layoutdefaults spacing="3" margin="6"/> + <layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> </UI> 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 @@ <!DOCTYPE UI><UI version="3.0" stdsetdef="1"> -<class>RealmFinishPageDlg</class> -<widget class="TQWidget"> - <property name="name"> - <cstring>RealmFinishPageDlg</cstring> - </property> - <property name="geometry"> - <rect> - <x>0</x> - <y>0</y> - <width>678</width> - <height>452</height> - </rect> - </property> - <grid> + <class>RealmFinishPageDlg</class> + <widget class="TQWidget"> <property name="name"> - <cstring>unnamed</cstring> + <cstring>RealmFinishPageDlg</cstring> </property> - <widget class="TQLabel" row="0" column="0" rowspan="9" colspan="1"> + <grid> <property name="name"> - <cstring>px_introSidebar</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>0</hsizetype> - <vsizetype>0</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>170</width> - <height>430</height> - </size> - </property> - <property name="frameShape"> - <enum>Panel</enum> - </property> - <property name="frameShadow"> - <enum>Sunken</enum> - </property> - <property name="scaledContents"> - <bool>true</bool> - </property> - <property name="indent"> - <number>0</number> - </property> - </widget> - <widget class="TQLabel" row="0" column="1"> - <property name="name"> - <cstring>txt_welcome</cstring> - </property> - <property name="text"> - <string><h3>Welcome to the TDE LDAP Realming Wizard!</h3></string> - </property> - </widget> - <widget class="TQLabel" row="1" column="1"> - <property name="name"> - <cstring>TextLabel6</cstring> - </property> - <property name="sizePolicy"> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>1</vsizetype> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> - <property name="text"> - <string><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></string> - </property> - <property name="textFormat"> - <enum>RichText</enum> - </property> - <property name="alignment"> - <set>WordBreak|AlignTop|AlignLeft</set> - </property> - <property name="vAlign" stdset="0"> - </property> - <property name="wordwrap" stdset="0"> - </property> - </widget> - <spacer row="2" column="1"> - <property name="name"> - <cstring>Spacer6</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Fixed</enum> - </property> - <property name="sizeHint"> - <size> - <width>20</width> - <height>30</height> - </size> - </property> + <cstring>unnamed</cstring> + </property> + <widget class="TQLabel" row="0" column="0" rowspan="9" colspan="1"> + <property name="name"> + <cstring>px_introSidebar</cstring> + </property> + <property name="sizePolicy"> + <sizepolicy> + <hsizetype>0</hsizetype> + <vsizetype>0</vsizetype> + <horstretch>0</horstretch> + <verstretch>0</verstretch> + </sizepolicy> + </property> + <property name="minimumSize"> + <size> + <width>170</width> + <height>430</height> + </size> + </property> + <property name="frameShape"> + <enum>Panel</enum> + </property> + <property name="frameShadow"> + <enum>Sunken</enum> + </property> + <property name="scaledContents"> + <bool>true</bool> + </property> + <property name="indent"> + <number>0</number> + </property> + </widget> + <widget class="TQLabel" row="0" column="1" colspan="2"> + <property name="name"> + <cstring>yad_string</cstring> + </property> + <property name="text"> + <string><h3>You're almost done!</h3></string> + </property> + </widget> + <widget class="TQLabel" row="1" column="1" colspan="2"> + <property name="name"> + <cstring>passprompt</cstring> + </property> + <property name="text"> + <string>Please provide new LDAP realm administrator credentials below to finish setup</string> + </property> + </widget> + <widget class="TQLabel" row="2" column="1"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Username</string> + </property> + </widget> + <widget class="KLineEdit" row="2" column="2"> + <property name="name"> + <cstring>ldapAdminUsername</cstring> + </property> + </widget> + <widget class="TQLabel" row="3" column="1"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Password</string> + </property> + </widget> + <widget class="KPasswordEdit" row="3" column="2"> + <property name="name"> + <cstring>ldapAdminPassword</cstring> + </property> + </widget> + <widget class="TQLabel" row="4" column="1"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>Confirm Password</string> + </property> + </widget> + <widget class="KPasswordEdit" row="4" column="2"> + <property name="name"> + <cstring>ldapConfirmAdminPassword</cstring> + </property> + </widget> + <widget class="TQLabel" row="5" column="1"> + <property name="name"> + <cstring>unnamed</cstring> + </property> + <property name="text"> + <string>LDAP Realm</string> + </property> + </widget> + <widget class="KLineEdit" row="5" column="2"> + <property name="name"> + <cstring>ldapAdminRealm</cstring> + </property> + </widget> + <spacer row="6" column="1"> + <property name="name"> + <cstring>Spacer6</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Fixed</enum> + </property> + <property name="sizeHint"> + <size> + <width>20</width> + <height>30</height> + </size> + </property> </spacer> <spacer row="7" column="1"> - <property name="name"> - <cstring>Spacer5</cstring> - </property> - <property name="orientation"> - <enum>Vertical</enum> - </property> - <property name="sizeType"> - <enum>Expanding</enum> - </property> - </spacer> - </grid> -</widget> -<layoutdefaults spacing="3" margin="6"/> -<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> + <property name="name"> + <cstring>Spacer5</cstring> + </property> + <property name="orientation"> + <enum>Vertical</enum> + </property> + <property name="sizeType"> + <enum>Expanding</enum> + </property> + </spacer> + </grid> + </widget> + <layoutdefaults spacing="3" margin="6"/> + <layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> </UI> 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 @@ <cstring>txt_welcome</cstring> </property> <property name="text"> - <string><h3>Welcome to the TDE LDAP Realming Wizard!</h3></string> + <string><h3>Welcome to the TDE LDAP Realm Setup Wizard!</h3></string> </property> </widget> <widget class="TQLabel" row="1" column="1"> @@ -68,8 +68,8 @@ </sizepolicy> </property> <property name="text"> - <string><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> + <string><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></string> </property> <property name="textFormat"> 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 <kapplication.h> #include <kwizard.h> +#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. |