|
|
|
@ -740,7 +740,7 @@ void add_multiple_attributes_operation(LDAPMod **mods, int *i, TQString attr, TQ
|
|
|
|
|
(*i)++;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::updateUserInfo(LDAPUserInfo user) {
|
|
|
|
|
int LDAPManager::updateUserInfo(LDAPUserInfo user, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
int i;
|
|
|
|
|
LDAPUserInfo userinfo;
|
|
|
|
@ -842,7 +842,12 @@ int LDAPManager::updateUserInfo(LDAPUserInfo user) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP modification failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP modification failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP modification failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -1322,7 +1327,7 @@ int LDAPManager::destroyKerberosTicket(TQString principal, TQString *errstr) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::updateGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
int LDAPManager::updateGroupInfo(LDAPGroupInfo group, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
int i;
|
|
|
|
|
LDAPGroupInfo groupinfo;
|
|
|
|
@ -1387,7 +1392,12 @@ int LDAPManager::updateGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP modification failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP modification failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP modification failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -1396,7 +1406,7 @@ int LDAPManager::updateGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::addUserInfo(LDAPUserInfo user) {
|
|
|
|
|
int LDAPManager::addUserInfo(LDAPUserInfo user, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
int i;
|
|
|
|
|
LDAPUserInfo userinfo;
|
|
|
|
@ -1457,7 +1467,12 @@ int LDAPManager::addUserInfo(LDAPUserInfo user) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP addition failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP addition failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP addition failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -1466,7 +1481,7 @@ int LDAPManager::addUserInfo(LDAPUserInfo user) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::addGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
int LDAPManager::addGroupInfo(LDAPGroupInfo group, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
int i;
|
|
|
|
|
LDAPGroupInfo groupinfo;
|
|
|
|
@ -1520,7 +1535,12 @@ int LDAPManager::addGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP addition failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP addition failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP addition failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -1644,7 +1664,7 @@ int LDAPManager::addServiceInfo(LDAPServiceInfo service, TQString *errstr) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::deleteUserInfo(LDAPUserInfo user) {
|
|
|
|
|
int LDAPManager::deleteUserInfo(LDAPUserInfo user, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
LDAPUserInfo userinfo;
|
|
|
|
|
|
|
|
|
@ -1655,7 +1675,12 @@ int LDAPManager::deleteUserInfo(LDAPUserInfo user) {
|
|
|
|
|
// Delete the base DN entry
|
|
|
|
|
retcode = ldap_delete_ext_s(m_ldap, user.distinguishedName.ascii(), NULL, NULL);
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -1664,7 +1689,7 @@ int LDAPManager::deleteUserInfo(LDAPUserInfo user) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::deleteGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
int LDAPManager::deleteGroupInfo(LDAPGroupInfo group, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
LDAPGroupInfo groupinfo;
|
|
|
|
|
|
|
|
|
@ -1675,7 +1700,12 @@ int LDAPManager::deleteGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
// Delete the base DN entry
|
|
|
|
|
retcode = ldap_delete_ext_s(m_ldap, group.distinguishedName.ascii(), NULL, NULL);
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -1684,7 +1714,7 @@ int LDAPManager::deleteGroupInfo(LDAPGroupInfo group) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::deleteMachineInfo(LDAPMachineInfo machine) {
|
|
|
|
|
int LDAPManager::deleteMachineInfo(LDAPMachineInfo machine, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
LDAPMachineInfo machineinfo;
|
|
|
|
|
|
|
|
|
@ -1695,7 +1725,12 @@ int LDAPManager::deleteMachineInfo(LDAPMachineInfo machine) {
|
|
|
|
|
// Delete the base DN entry
|
|
|
|
|
retcode = ldap_delete_ext_s(m_ldap, machine.distinguishedName.ascii(), NULL, NULL);
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
@ -1704,7 +1739,7 @@ int LDAPManager::deleteMachineInfo(LDAPMachineInfo machine) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int LDAPManager::deleteServiceInfo(LDAPServiceInfo service) {
|
|
|
|
|
int LDAPManager::deleteServiceInfo(LDAPServiceInfo service, TQString *errstr) {
|
|
|
|
|
int retcode;
|
|
|
|
|
LDAPServiceInfo serviceinfo;
|
|
|
|
|
|
|
|
|
@ -1715,7 +1750,12 @@ int LDAPManager::deleteServiceInfo(LDAPServiceInfo service) {
|
|
|
|
|
// Delete the base DN entry
|
|
|
|
|
retcode = ldap_delete_ext_s(m_ldap, service.distinguishedName.ascii(), NULL, NULL);
|
|
|
|
|
if (retcode != LDAP_SUCCESS) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
if (errstr) {
|
|
|
|
|
*errstr = i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>LDAP deletion failure<p>Reason: [%3] %4</qt>").arg(retcode).arg(ldap_err2string(retcode)), i18n("LDAP Error"));
|
|
|
|
|
}
|
|
|
|
|
return -2;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|