From 75044dd48af51f848e49f6705ec6e9423571dd8c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Wed, 6 Jun 2012 04:16:24 -0500 Subject: Add ssl generation and storage --- src/certconfigpage.cpp | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) (limited to 'src/certconfigpage.cpp') diff --git a/src/certconfigpage.cpp b/src/certconfigpage.cpp index 1e94336..2a5b6e6 100644 --- a/src/certconfigpage.cpp +++ b/src/certconfigpage.cpp @@ -48,11 +48,20 @@ CertConfigPage::CertConfigPage(TQWidget *parent, const char *name ) : CertConfig connect(generateKeysDisabled, TQT_SIGNAL(stateChanged(int)), this, TQT_SLOT(setUseProvidedKeys(int))); connect(kerberosPEM, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(kerberosPEMKEY, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); connect(kerberosCRT, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); connect(kerberosKEY, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); connect(ldapCRT, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); connect(ldapKEY, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(organizationName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(orgUnitName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(commonName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(localityName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(stateOrProvinceName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(countryName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + connect(emailAddress, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(validateEntries())); + m_parentWizard = dynamic_cast(parent); m_parentDialog = dynamic_cast(parent); } @@ -81,19 +90,33 @@ void CertConfigPage::setUseProvidedKeys(int state) { void CertConfigPage::processLockouts() { kerberosPEM->setEnabled(generateKeysDisabled->isOn()); + kerberosPEMKEY->setEnabled(generateKeysDisabled->isOn()); kerberosCRT->setEnabled(generateKeysDisabled->isOn()); kerberosKEY->setEnabled(generateKeysDisabled->isOn()); ldapCRT->setEnabled(generateKeysDisabled->isOn()); ldapKEY->setEnabled(generateKeysDisabled->isOn()); + + organizationName->setEnabled(generateKeysEnabled->isOn()); + orgUnitName->setEnabled(generateKeysEnabled->isOn()); + commonName->setEnabled(generateKeysEnabled->isOn()); + localityName->setEnabled(generateKeysEnabled->isOn()); + stateOrProvinceName->setEnabled(generateKeysEnabled->isOn()); + countryName->setEnabled(generateKeysEnabled->isOn()); + emailAddress->setEnabled(generateKeysEnabled->isOn()); } void CertConfigPage::validateEntries() { if (m_parentWizard) { if (generateKeysEnabled->isOn()) { - m_parentWizard->nextButton()->setEnabled(true); + if ((organizationName->text() != "") && (orgUnitName->text() != "") && (commonName->text() != "") && (localityName->text() != "") && (stateOrProvinceName->text() != "") && (countryName->text() != "") && (emailAddress->text() != "")) { + m_parentWizard->nextButton()->setEnabled(true); + } + else { + m_parentWizard->nextButton()->setEnabled(false); + } } else { - if ((kerberosPEM->url() != "") && (kerberosCRT->url() != "") && (kerberosKEY->url() != "") && (ldapCRT->url() != "") && (ldapKEY->url() != "")) { + if ((kerberosPEM->url() != "") && (kerberosPEMKEY->url() != "") && (kerberosCRT->url() != "") && (kerberosKEY->url() != "") && (ldapCRT->url() != "") && (ldapKEY->url() != "")) { m_parentWizard->nextButton()->setEnabled(true); } else { @@ -103,10 +126,15 @@ void CertConfigPage::validateEntries() { } if (m_parentDialog) { if (generateKeysEnabled->isOn()) { - m_parentDialog->enableButton(KDialogBase::Ok, true); + if ((organizationName->text() != "") && (orgUnitName->text() != "") && (commonName->text() != "") && (localityName->text() != "") && (stateOrProvinceName->text() != "") && (countryName->text() != "") && (emailAddress->text() != "")) { + m_parentDialog->enableButton(KDialogBase::Ok, true); + } + else { + m_parentDialog->enableButton(KDialogBase::Ok, false); + } } else { - if ((kerberosPEM->url() != "") && (kerberosCRT->url() != "") && (kerberosKEY->url() != "") && (ldapCRT->url() != "") && (ldapKEY->url() != "")) { + if ((kerberosPEM->url() != "") && (kerberosPEMKEY->url() != "") && (kerberosCRT->url() != "") && (kerberosKEY->url() != "") && (ldapCRT->url() != "") && (ldapKEY->url() != "")) { m_parentDialog->enableButton(KDialogBase::Ok, true); } else { -- cgit v1.2.1