diff options
author | Timothy Pearson <[email protected]> | 2012-05-17 02:51:15 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-05-17 02:51:15 -0500 |
commit | 8fdae616e94a37d5abf2d8a02fcff8a93d2f2ed1 (patch) | |
tree | 6f7b6e55c5fc5f845630ba18b8aa40bbbc9084a5 /src/ldap.cpp | |
parent | 273c3c806ac25fb81ba1d29cb5bdcb907c5fc59a (diff) | |
download | kcmldap-8fdae616e94a37d5abf2d8a02fcff8a93d2f2ed1.tar.gz kcmldap-8fdae616e94a37d5abf2d8a02fcff8a93d2f2ed1.zip |
Fix FTBFS
Diffstat (limited to 'src/ldap.cpp')
-rw-r--r-- | src/ldap.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/ldap.cpp b/src/ldap.cpp index 54e8bff..2cd0d27 100644 --- a/src/ldap.cpp +++ b/src/ldap.cpp @@ -36,16 +36,28 @@ #include "ldap.h" +// FIXME +// Connect this to CMake/Automake +#define KDE_CONFDIR "/etc/trinity" + typedef KGenericFactory<ldap, TQWidget> ldapFactory; K_EXPORT_COMPONENT_FACTORY( kcm_ldap, ldapFactory("kcmldap")) +KSimpleConfig *systemconfig; + ldap::ldap(TQWidget *parent, const char *name, const TQStringList&) : KCModule(parent, name), myAboutData(0) { - // FIXME - // Add UI base widget to 'this' + TQVBoxLayout *layout = new TQVBoxLayout(this, KDialog::marginHint(), KDialog::spacingHint()); + 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(); 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, "[email protected]"); setAboutData( about ); + + + if (getuid() != 0 || !systemconfig->checkConfigFilesWritable( true )) { + base->systemEnableSupport->setEnabled(false); + } }; ldap::~ldap() { + delete systemconfig; } void ldap::load() { |