diff options
Diffstat (limited to 'src/realmpropertiesdialog.cpp')
-rw-r--r-- | src/realmpropertiesdialog.cpp | 60 |
1 files changed, 54 insertions, 6 deletions
diff --git a/src/realmpropertiesdialog.cpp b/src/realmpropertiesdialog.cpp index 2ae9428..eaf09e2 100644 --- a/src/realmpropertiesdialog.cpp +++ b/src/realmpropertiesdialog.cpp @@ -20,23 +20,71 @@ #include <klocale.h> #include <klineedit.h> +#include <ktextedit.h> +#include <knuminput.h> #include <kactionselector.h> #include <tqlistbox.h> #include <kpushbutton.h> #include <tqpixmap.h> #include <tqiconset.h> +#include <tqlabel.h> #include "realmpropertiesdialog.h" -RealmPropertiesDialog::RealmPropertiesDialog(LDAPRealmConfig* realm, TQWidget* parent, const char* name) - : KDialogBase(parent, name, true, i18n("Realm Properties"), Ok|Cancel, Ok, true), m_realmConfig(realm) +RealmPropertiesDialog::RealmPropertiesDialog(LDAPRealmConfigList *realmList, TQString realmName, TQWidget* parent, const char* name) + : KDialogBase(parent, name, true, i18n("Realm Properties"), Ok|Cancel, Ok, true), m_realmList(realmList), m_realmName(realmName) { - m_base = new RealmPropertiesBase(this); + m_base = new BondRealmPage(this); + + m_base->txtRealmName->setEnabled(false); + m_base->txtKDC->setEnabled(false); + m_base->txtKDCPort->setEnabled(false); + m_base->txtAdminServer->setEnabled(false); + m_base->txtAdminServerPort->setEnabled(false); + + m_base->px_introSidebar->hide(); + + LDAPRealmConfig realm = (*m_realmList)[m_realmName]; + + // Load values into dialog + m_base->txtRealmName->setText(realm.name); + m_base->txtUIDOffset->setValue(realm.uid_offset); + m_base->txtGIDOffset->setValue(realm.gid_offset); + m_base->txtDomains->setText(realm.domain_mappings.join("\n")); + m_base->txtKDC->setText(realm.kdc); + m_base->txtKDCPort->setValue(realm.kdc_port); + m_base->txtAdminServer->setText(realm.admin_server); + m_base->txtAdminServerPort->setValue(realm.admin_server_port); + m_base->checkRequireEKU->setChecked(realm.pkinit_require_eku); + m_base->checkRequireKrbtgtOtherName->setChecked(realm.pkinit_require_krbtgt_otherName); + m_base->checkWin2k->setChecked(realm.win2k_pkinit); + m_base->checkWin2kPkinitRequireBinding->setChecked(realm.win2k_pkinit_require_binding); + + setMainWidget(m_base); } -void RealmPropertiesDialog::slotOk() -{ - // accept(); or reject(); +void RealmPropertiesDialog::slotOk() { + // Load values into realmcfg + LDAPRealmConfig realm = (*m_realmList)[m_realmName]; + + realm.name = m_base->txtRealmName->text(); + realm.uid_offset = m_base->txtUIDOffset->value(); + realm.gid_offset = m_base->txtGIDOffset->value(); + realm.domain_mappings = TQStringList::split("\n", m_base->txtDomains->text(), FALSE); + realm.kdc = m_base->txtKDC->text(); + realm.kdc_port = m_base->txtKDCPort->value(); + realm.admin_server = m_base->txtAdminServer->text(); + realm.admin_server_port = m_base->txtAdminServerPort->value(); + realm.pkinit_require_eku = m_base->checkRequireEKU->isChecked(); + realm.pkinit_require_krbtgt_otherName = m_base->checkRequireKrbtgtOtherName->isChecked(); + realm.win2k_pkinit = m_base->checkWin2k->isChecked(); + realm.win2k_pkinit_require_binding = m_base->checkWin2kPkinitRequireBinding->isChecked(); + + // Remove m_realmName and re-add it + m_realmList->remove(m_realmName); + m_realmList->insert(m_realmName, realm); + + accept(); } #include "realmpropertiesdialog.moc" |