Use TDESimpleConfig

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
master
Michele Calgaro 2 months ago
parent 6933039a32
commit bce38cef45
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -23,7 +23,7 @@
#include <tqmap.h> #include <tqmap.h>
#include <tdeapplication.h> #include <tdeapplication.h>
#include <ksimpleconfig.h> #include <tdesimpleconfig.h>
#include <tdelocale.h> #include <tdelocale.h>
#include <kdebug.h> #include <kdebug.h>
#include <tdestandarddirs.h> #include <tdestandarddirs.h>

@ -35,7 +35,7 @@
#include <tdemessagebox.h> #include <tdemessagebox.h>
#include <klineedit.h> #include <klineedit.h>
#include <kpassdlg.h> #include <kpassdlg.h>
#include <ksimpleconfig.h> #include <tdesimpleconfig.h>
#include <tdesu/process.h> #include <tdesu/process.h>
#include <ksslcertificate.h> #include <ksslcertificate.h>
#include <krfcdate.h> #include <krfcdate.h>
@ -1663,7 +1663,7 @@ KerberosTicketInfoList LDAPManager::getKerberosTicketList(TQString cache, TQStri
LDAPRealmConfigList LDAPManager::fetchAndReadTDERealmList(TQString *defaultRealm) LDAPRealmConfigList LDAPManager::fetchAndReadTDERealmList(TQString *defaultRealm)
{ {
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
systemconfig->setGroup(NULL); systemconfig->setGroup(NULL);
if (defaultRealm != NULL) { if (defaultRealm != NULL) {
*defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null); *defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null);
@ -1728,7 +1728,7 @@ int LDAPManager::obtainKerberosTicket(LDAPCredentials creds, TQString principal,
QCStringList args; QCStringList args;
if (creds.use_smartcard) { if (creds.use_smartcard) {
// Get PKCS#11 slot number from the LDAP configuration file // Get PKCS#11 slot number from the LDAP configuration file
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
systemconfig->setGroup(NULL); systemconfig->setGroup(NULL);
int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0); int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0);
delete systemconfig; delete systemconfig;
@ -3296,7 +3296,7 @@ int LDAPManager::moveKerberosEntries(TQString newSuffix, TQString* errstr) {
} }
int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole machineRole, TQString *errstr) { int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole machineRole, TQString *errstr) {
KSimpleConfig* systemconfig; TDESimpleConfig* systemconfig;
TQString m_defaultRealm; TQString m_defaultRealm;
int m_ldapVersion; int m_ldapVersion;
int m_ldapTimeout; int m_ldapTimeout;
@ -3306,7 +3306,7 @@ int LDAPManager::writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole mac
TQString m_ignoredUsers; TQString m_ignoredUsers;
TQCString command; TQCString command;
systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
systemconfig->setGroup(NULL); systemconfig->setGroup(NULL);
m_defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null); m_defaultRealm = systemconfig->readEntry("DefaultRealm", TQString::null);
@ -4301,7 +4301,7 @@ int LDAPManager::installCACertificateInHostCAStore(TQString *errstr) {
int LDAPManager::retrieveAndInstallCaCrl(LDAPManager* manager, TQString *errstr) { int LDAPManager::retrieveAndInstallCaCrl(LDAPManager* manager, TQString *errstr) {
int retcode = 0; int retcode = 0;
LDAPManager* ldap_mgr = manager; LDAPManager* ldap_mgr = manager;
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
LDAPRealmConfigList realms = LDAPManager::readTDERealmList(systemconfig, false); LDAPRealmConfigList realms = LDAPManager::readTDERealmList(systemconfig, false);
if (!ldap_mgr) { if (!ldap_mgr) {
@ -4336,7 +4336,7 @@ int LDAPManager::retrieveAndInstallCaCrl(LDAPManager* manager, TQString *errstr)
return retcode; return retcode;
} }
LDAPRealmConfigList LDAPManager::readTDERealmList(KSimpleConfig* config, bool disableAllBonds) { LDAPRealmConfigList LDAPManager::readTDERealmList(TDESimpleConfig* config, bool disableAllBonds) {
LDAPRealmConfigList realms; LDAPRealmConfigList realms;
TQStringList cfgRealms = config->groupList(); TQStringList cfgRealms = config->groupList();
@ -4375,7 +4375,7 @@ LDAPRealmConfigList LDAPManager::readTDERealmList(KSimpleConfig* config, bool di
return realms; return realms;
} }
int LDAPManager::writeTDERealmList(LDAPRealmConfigList realms, KSimpleConfig* config, TQString *errstr) { int LDAPManager::writeTDERealmList(LDAPRealmConfigList realms, TDESimpleConfig* config, TQString *errstr) {
Q_UNUSED(errstr) Q_UNUSED(errstr)
LDAPRealmConfigList::Iterator it; LDAPRealmConfigList::Iterator it;
@ -4860,7 +4860,7 @@ TQString LDAPManager::getMachineFQDN() {
return fqdn; return fqdn;
} }
LDAPClientRealmConfig LDAPManager::loadClientRealmConfig(KSimpleConfig* config, bool useDefaults) { LDAPClientRealmConfig LDAPManager::loadClientRealmConfig(TDESimpleConfig* config, bool useDefaults) {
LDAPClientRealmConfig clientRealmConfig; LDAPClientRealmConfig clientRealmConfig;
config->setReadDefaults(useDefaults); config->setReadDefaults(useDefaults);
@ -4894,7 +4894,7 @@ LDAPClientRealmConfig LDAPManager::loadClientRealmConfig(KSimpleConfig* config,
return clientRealmConfig; return clientRealmConfig;
} }
int LDAPManager::saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, KSimpleConfig* config, TQString *errstr) { int LDAPManager::saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, TDESimpleConfig* config, TQString *errstr) {
Q_UNUSED(errstr) Q_UNUSED(errstr)
config->setGroup(NULL); config->setGroup(NULL);
@ -4936,7 +4936,7 @@ int LDAPManager::writeClientKrb5ConfFile(LDAPClientRealmConfig clientRealmConfig
stream << "\n"; stream << "\n";
// Get PKCS#11 slot number from the LDAP configuration file // Get PKCS#11 slot number from the LDAP configuration file
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
systemconfig->setGroup(NULL); systemconfig->setGroup(NULL);
int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0); int pkcs11_login_card_slot = systemconfig->readNumEntry("PKCS11LoginCardSlot", 0);
delete systemconfig; delete systemconfig;
@ -5560,7 +5560,7 @@ int LDAPManager::writeOpenSSLConfigurationFile(LDAPRealmConfig realmcfg, LDAPUse
bool LDAPManager::pkcsLoginEnabled() { bool LDAPManager::pkcsLoginEnabled() {
bool enabled; bool enabled;
KSimpleConfig* systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" )); TDESimpleConfig* systemconfig = new TDESimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
systemconfig->setGroup(NULL); systemconfig->setGroup(NULL);
enabled = systemconfig->readBoolEntry("EnablePKCS11Login", false); enabled = systemconfig->readBoolEntry("EnablePKCS11Login", false);
delete systemconfig; delete systemconfig;

@ -33,7 +33,7 @@
#include <tqvaluelist.h> #include <tqvaluelist.h>
#include <tqfile.h> #include <tqfile.h>
#include <ksimpleconfig.h> #include <tdesimpleconfig.h>
// FIXME // FIXME
// Connect this to CMake/Automake // Connect this to CMake/Automake
@ -548,9 +548,9 @@ class TDE_EXPORT LDAPManager : public TQObject {
static int installCACertificateInHostCAStore(TQString *errstr=0); static int installCACertificateInHostCAStore(TQString *errstr=0);
static int retrieveAndInstallCaCrl(LDAPManager* manager=0, TQString *errstr=0); static int retrieveAndInstallCaCrl(LDAPManager* manager=0, TQString *errstr=0);
static TQString getMachineFQDN(); static TQString getMachineFQDN();
static int writeTDERealmList(LDAPRealmConfigList realms, KSimpleConfig* config, TQString *errstr=0); static int writeTDERealmList(LDAPRealmConfigList realms, TDESimpleConfig* config, TQString *errstr=0);
static LDAPRealmConfigList fetchAndReadTDERealmList(TQString *defaultRealm=0); static LDAPRealmConfigList fetchAndReadTDERealmList(TQString *defaultRealm=0);
static LDAPRealmConfigList readTDERealmList(KSimpleConfig* config, bool disableAllBonds=false); static LDAPRealmConfigList readTDERealmList(TDESimpleConfig* config, bool disableAllBonds=false);
static TQDateTime getCertificateExpiration(TQString certfile); static TQDateTime getCertificateExpiration(TQString certfile);
static TQDateTime getCertificateExpiration(TQByteArray certfileContents); static TQDateTime getCertificateExpiration(TQByteArray certfileContents);
@ -577,8 +577,8 @@ class TDE_EXPORT LDAPManager : public TQObject {
static TQString detailedKAdminErrorMessage(TQString initialMessage); static TQString detailedKAdminErrorMessage(TQString initialMessage);
static TQString readFullLineFromPtyProcess(PtyProcess* proc); static TQString readFullLineFromPtyProcess(PtyProcess* proc);
static LDAPClientRealmConfig loadClientRealmConfig(KSimpleConfig* config, bool useDefaults=false); static LDAPClientRealmConfig loadClientRealmConfig(TDESimpleConfig* config, bool useDefaults=false);
static int saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, KSimpleConfig* config, TQString *errstr=0); static int saveClientRealmConfig(LDAPClientRealmConfig clientRealmConfig, TDESimpleConfig* config, TQString *errstr=0);
static int writeClientKrb5ConfFile(LDAPClientRealmConfig clientRealmConfig, LDAPRealmConfigList realmList, TQString *errstr=0); static int writeClientKrb5ConfFile(LDAPClientRealmConfig clientRealmConfig, LDAPRealmConfigList realmList, TQString *errstr=0);
static int writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole machineRole, TQString *errstr=0); static int writeLDAPConfFile(LDAPRealmConfig realmcfg, LDAPMachineRole machineRole, TQString *errstr=0);
static int writeNSSwitchFile(TQString *errstr=0); static int writeNSSwitchFile(TQString *errstr=0);

Loading…
Cancel
Save