pull/1/head
Timothy Pearson 13 years ago
parent 273c3c806a
commit 8fdae616e9

@ -36,16 +36,28 @@
#include "ldap.h" #include "ldap.h"
// FIXME
// Connect this to CMake/Automake
#define KDE_CONFDIR "/etc/trinity"
typedef KGenericFactory<ldap, TQWidget> ldapFactory; typedef KGenericFactory<ldap, TQWidget> ldapFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_ldap, ldapFactory("kcmldap")) K_EXPORT_COMPONENT_FACTORY( kcm_ldap, ldapFactory("kcmldap"))
KSimpleConfig *systemconfig;
ldap::ldap(TQWidget *parent, const char *name, const TQStringList&) ldap::ldap(TQWidget *parent, const char *name, const TQStringList&)
: KCModule(parent, name), myAboutData(0) : KCModule(parent, name), myAboutData(0)
{ {
// FIXME TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint());
// Add UI base widget to 'this' systemconfig = new KSimpleConfig( TQString::fromLatin1( KDE_CONFDIR "/ldap/ldapconfigrc" ));
base = new LDAPConfigBase(this);
layout->add(base);
setRootOnlyMsg(i18n("<b>Bonded LDAP realms take effect system wide, and require administrator access to modify</b><br>To alter the system's bonded LDAP realms, click on the \"Administrator Mode\" button below."));
setUseRootOnlyMsg(true);
load(); load();
KAboutData* about = new KAboutData("ldap", I18N_NOOP("TDE LDAP Manager"), "0.1", KAboutData* about = new KAboutData("ldap", I18N_NOOP("TDE LDAP Manager"), "0.1",
@ -55,9 +67,15 @@ ldap::ldap(TQWidget *parent, const char *name, const TQStringList&)
about->addAuthor("Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net"); about->addAuthor("Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net");
setAboutData( about ); setAboutData( about );
if (getuid() != 0 || !systemconfig->checkConfigFilesWritable( true )) {
base->systemEnableSupport->setEnabled(false);
}
}; };
ldap::~ldap() { ldap::~ldap() {
delete systemconfig;
} }
void ldap::load() { void ldap::load() {

@ -29,9 +29,14 @@
#include <kglobalsettings.h> #include <kglobalsettings.h>
#include <tqpushbutton.h> #include <tqpushbutton.h>
#include <tqcombobox.h> #include <tqcombobox.h>
#include <tqcheckbox.h>
#include "ldapconfigbase.h" #include "ldapconfigbase.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
class ldap: public KCModule class ldap: public KCModule
{ {
Q_OBJECT Q_OBJECT
@ -50,6 +55,7 @@ class ldap: public KCModule
private: private:
KAboutData *myAboutData; KAboutData *myAboutData;
KGlobalSettings *kgs; KGlobalSettings *kgs;
LDAPConfigBase *base;
}; };
#endif #endif

Loading…
Cancel
Save