Adapted to new KPasswordEdit::password() signature. This relates to bug 2961.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 6 years ago
parent 7a5ac493f1
commit 0573dbda0a
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -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());

@ -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 {

@ -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 {

Loading…
Cancel
Save