diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-12-02 22:40:32 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2018-12-02 22:40:32 +0900 |
commit | 0573dbda0afe67a81c27cd0adbccc14d90759b7d (patch) | |
tree | 01a6bebc9200153fa860b990d2ea788a46f71997 | |
parent | 7a5ac493f1c47740eba8bac1f4c026471bd1b845 (diff) | |
download | kcmldapcontroller-0573dbda0afe67a81c27cd0adbccc14d90759b7d.tar.gz kcmldapcontroller-0573dbda0afe67a81c27cd0adbccc14d90759b7d.zip |
Adapted to new KPasswordEdit::password() signature. This relates to bug 2961.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
-rw-r--r-- | src/ldapcontroller.cpp | 13 | ||||
-rw-r--r-- | src/primaryrealmwizard/primaryrealmwizard.cpp | 6 | ||||
-rw-r--r-- | src/secondaryrealmwizard/secondaryrealmwizard.cpp | 4 |
3 files changed, 12 insertions, 11 deletions
diff --git a/src/ldapcontroller.cpp b/src/ldapcontroller.cpp index dfc4286..8572b2f 100644 --- a/src/ldapcontroller.cpp +++ b/src/ldapcontroller.cpp @@ -782,11 +782,12 @@ void LDAPController::btnChangeLDAPRootPassword() { bool ret = false; - TQCString rootPassword; + TQString rootPassword; int result = KPasswordDialog::getNewPassword(rootPassword, i18n("Please enter the new LDAP root password:")); if (result == KPasswordDialog::Accepted) { SHA1 sha; - sha.process(rootPassword, strlen(rootPassword)); + TQCString rootPassword2 = rootPassword.utf8(); // utf8 length could be different from TQString length + sha.process(rootPassword2, rootPassword2.length()); TQString rootpw_hash = sha.base64Hash(); TQString oldconfigfilename = "/etc/ldap/slapd.d/cn=config/" + TQString("olcDatabase={%1}hdb.ldif.bkp").arg(1); @@ -835,7 +836,7 @@ void LDAPController::btnChangeLDAPRootPassword() { } void LDAPController::btnChangeRealmAdminPassword() { - TQCString adminPassword; + TQString adminPassword; int result = KPasswordDialog::getNewPassword(adminPassword, i18n("Please enter the new realm administrator password:")); if (result == KPasswordDialog::Accepted) { TQString realmname = m_defaultRealm.upper(); @@ -853,7 +854,7 @@ void LDAPController::btnChangeRealmAdminPassword() { ldap_mgr->setPasswordForUser(adminuserinfo, &errorstring); m_systemconfig->setGroup("Replication"); - m_systemconfig->writeEntry("Password", adminPassword.data()); + m_systemconfig->writeEntry("Password", adminPassword); m_systemconfig->setGroup(NULL); m_systemconfig->sync(); } @@ -1609,7 +1610,7 @@ int LDAPController::setKerberosPasswordForUser(LDAPCredentials user, TQString *e } else if ((prompt.endsWith(" Password:")) && (prompt.startsWith(TQString(user.username + "@")))) { kadminProc.enableLocalEcho(false); - kadminProc.writeLine(user.password, true); + kadminProc.writeLine(user.password.utf8(), true); do { // Discard our own input prompt = LDAPManager::readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n\r", prompt.ascii()); @@ -1617,7 +1618,7 @@ int LDAPController::setKerberosPasswordForUser(LDAPCredentials user, TQString *e prompt = prompt.stripWhiteSpace(); if ((prompt.endsWith(" Password:")) && (prompt.startsWith("Verify"))) { kadminProc.enableLocalEcho(false); - kadminProc.writeLine(user.password, true); + kadminProc.writeLine(user.password.utf8(), true); do { // Discard our own input prompt = LDAPManager::readFullLineFromPtyProcess(&kadminProc); printf("(kadmin) '%s'\n\r", prompt.ascii()); diff --git a/src/primaryrealmwizard/primaryrealmwizard.cpp b/src/primaryrealmwizard/primaryrealmwizard.cpp index bfd96cd..5d4ce69 100644 --- a/src/primaryrealmwizard/primaryrealmwizard.cpp +++ b/src/primaryrealmwizard/primaryrealmwizard.cpp @@ -287,11 +287,11 @@ void PrimaryRealmWizard::closeEvent(TQCloseEvent* e){ /** maybe call a dialog that the wizard has finished. */ void PrimaryRealmWizard::accept() { // Validate entries - if (TQString(finishpage->ldapAdminPassword->password()) != TQString(finishpage->ldapConfirmAdminPassword->password())) { + if (finishpage->ldapAdminPassword->password() != finishpage->ldapConfirmAdminPassword->password()) { KMessageBox::error(this, i18n("<qt><b>Passwords do not match!</b><p>Please re-enter the new administration account password</qt>"), i18n("Input Error")); return; } - if (TQString(finishpage->ldapAdminPassword->password()) == "") { + if (finishpage->ldapAdminPassword->password() == "") { KMessageBox::error(this, i18n("<qt><b>Password required!</b><p>Please enter the new administration account password</qt>"), i18n("Input Error")); return; } @@ -307,7 +307,7 @@ void PrimaryRealmWizard::accept() { cancelButton()->setEnabled(false); finishpage->setEnabled(false); - if (m_controller->createNewLDAPRealm(this, m_realmconfig, finishpage->ldapAdminUsername->text(), finishpage->ldapAdminGroupname->text(), finishpage->ldapMachineAdminGroupname->text(), finishpage->ldapStandardUserGroupname->text(), finishpage->ldapAdminPassword->password(), "admin", finishpage->ldapAdminPassword->password(), finishpage->ldapAdminRealm->text(), m_certconfig, &errorString) == 0) { + if (m_controller->createNewLDAPRealm(this, m_realmconfig, finishpage->ldapAdminUsername->text(), finishpage->ldapAdminGroupname->text(), finishpage->ldapMachineAdminGroupname->text(), finishpage->ldapStandardUserGroupname->text(), finishpage->ldapAdminPassword->password().utf8(), "admin", finishpage->ldapAdminPassword->password().utf8(), finishpage->ldapAdminRealm->text(), m_certconfig, &errorString) == 0) { done(0); } else { diff --git a/src/secondaryrealmwizard/secondaryrealmwizard.cpp b/src/secondaryrealmwizard/secondaryrealmwizard.cpp index 99d0dda..a9e25c7 100644 --- a/src/secondaryrealmwizard/secondaryrealmwizard.cpp +++ b/src/secondaryrealmwizard/secondaryrealmwizard.cpp @@ -199,7 +199,7 @@ void SecondaryRealmWizard::closeEvent(TQCloseEvent* e){ /** maybe call a dialog that the wizard has finished. */ void SecondaryRealmWizard::accept() { // Validate entries - if (TQString(finishpage->ldapAdminPassword->password()) == "") { + if (finishpage->ldapAdminPassword->password() == "") { KMessageBox::error(this, i18n("<qt><b>Password required!</b><p>Please enter the administration account password</qt>"), i18n("Input Error")); return; } @@ -215,7 +215,7 @@ void SecondaryRealmWizard::accept() { cancelButton()->setEnabled(false); finishpage->setEnabled(false); - if (m_controller->createNewSecondaryController(this, m_realmconfig, finishpage->ldapAdminUsername->text(), finishpage->ldapAdminPassword->password(), finishpage->ldapAdminRealm->text(), &errorString) == 0) { + if (m_controller->createNewSecondaryController(this, m_realmconfig, finishpage->ldapAdminUsername->text(), finishpage->ldapAdminPassword->password().utf8(), finishpage->ldapAdminRealm->text(), &errorString) == 0) { done(0); } else { |