summaryrefslogtreecommitdiffstats
path: root/src/ldapbonding.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-04-12 10:20:56 -0500
committerTimothy Pearson <[email protected]>2013-04-12 10:20:56 -0500
commit27b49086f03315c32d30a0658e44958abd47a3ef (patch)
treeb2334b80a04c4982c135a1ad228172ea2c8b3c66 /src/ldapbonding.cpp
parent3caa3ef1be6a44a10df19ab95d01f69528667368 (diff)
downloadkcmldap-27b49086f03315c32d30a0658e44958abd47a3ef.tar.gz
kcmldap-27b49086f03315c32d30a0658e44958abd47a3ef.zip
Add ability to control PAM options including credential caching and home directory creation
Diffstat (limited to 'src/ldapbonding.cpp')
-rw-r--r--src/ldapbonding.cpp29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/ldapbonding.cpp b/src/ldapbonding.cpp
index fbf1006..9bc23db 100644
--- a/src/ldapbonding.cpp
+++ b/src/ldapbonding.cpp
@@ -44,6 +44,7 @@
#include <tdesu/process.h>
+#include "tdeumaskinput.h"
#include "ldapbonding.h"
#include "bondwizard.h"
#include "ldappasswddlg.h"
@@ -101,6 +102,12 @@ LDAPConfig::LDAPConfig(TQWidget *parent, const char *name, const TQStringList&)
connect(base->passwordHash, TQT_SIGNAL(activated(int)), this, TQT_SLOT(changed()));
connect(base->ignoredUsers, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(changed()));
+ connect(base->pamEnableCachedLogons, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+ connect(base->pamCreateHomeDirectory, TQT_SIGNAL(clicked()), this, TQT_SLOT(changed()));
+ connect(base->pamCreateHomeDirectory, TQT_SIGNAL(clicked()), this, TQT_SLOT(processLockouts()));
+ connect(base->pamCreateHomeDirectoryUmask, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(changed()));
+ connect(base->pamCreateHomeDirectorySkelDir, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(changed()));
+
hostFQDN = LDAPManager::getMachineFQDN();
base->hostFQDN->setEnabled(false);
base->hostFQDN->clear();
@@ -158,6 +165,11 @@ void LDAPConfig::load(bool useDefaults )
}
base->ignoredUsers->setText(m_clientRealmConfig.ignoredUsers);
+ base->pamEnableCachedLogons->setChecked(m_clientRealmConfig.pamConfig.enable_cached_credentials);
+ base->pamCreateHomeDirectory->setChecked(m_clientRealmConfig.pamConfig.autocreate_user_directories_enable);
+ base->pamCreateHomeDirectoryUmask->setValue(m_clientRealmConfig.pamConfig.autocreate_user_directories_umask);
+ base->pamCreateHomeDirectorySkelDir->setURL(m_clientRealmConfig.pamConfig.autocreate_user_directories_skel);
+
updateRealmList();
processLockouts();
@@ -205,6 +217,11 @@ void LDAPConfig::save() {
m_clientRealmConfig.passwordHash = base->passwordHash->currentText();
m_clientRealmConfig.ignoredUsers = base->ignoredUsers->text();
+ m_clientRealmConfig.pamConfig.enable_cached_credentials = base->pamEnableCachedLogons->isChecked();
+ m_clientRealmConfig.pamConfig.autocreate_user_directories_enable = base->pamCreateHomeDirectory->isChecked();
+ m_clientRealmConfig.pamConfig.autocreate_user_directories_umask = base->pamCreateHomeDirectoryUmask->value();
+ m_clientRealmConfig.pamConfig.autocreate_user_directories_skel = base->pamCreateHomeDirectorySkelDir->url();
+
// Write system configuration
if (LDAPManager::saveClientRealmConfig(m_clientRealmConfig, systemconfig, &errorstring) != 0) {
KMessageBox::error(this, i18n("<qt><b>Unable to save configuration!</b><p>Details: %2</qt>").arg(errorstring), i18n("Unable to Save Configuration"));
@@ -231,7 +248,7 @@ void LDAPConfig::save() {
return;
}
// Write the PAM configuration files
- if (LDAPManager::writePAMFiles(&errorstring) != 0) {
+ if (LDAPManager::writePAMFiles(m_clientRealmConfig.pamConfig, &errorstring) != 0) {
KMessageBox::error(this, i18n("<qt><b>Unable to save configuration!</b><p>Details: %2</qt>").arg(errorstring), i18n("Unable to Save Configuration"));
return;
}
@@ -284,6 +301,7 @@ void LDAPConfig::processLockouts() {
base->groupRealms->setEnabled(panelIsEnabled);
base->groupKrbDefaults->setEnabled(panelIsEnabled);
base->groupConnectionParameters->setEnabled(panelIsEnabled);
+ base->groupPamConfig->setEnabled(panelIsEnabled);
TQListViewItem *selrealm = base->ldapRealmList->selectedItem();
if (selrealm) {
@@ -308,6 +326,15 @@ void LDAPConfig::processLockouts() {
base->btnRemoveRealm->setEnabled(false);
base->btnRealmProperties->setEnabled(false);
}
+
+ if (base->pamCreateHomeDirectory->isChecked()) {
+ base->pamCreateHomeDirectoryUmask->setEnabled(true);
+ base->pamCreateHomeDirectorySkelDir->setEnabled(true);
+ }
+ else {
+ base->pamCreateHomeDirectoryUmask->setEnabled(false);
+ base->pamCreateHomeDirectorySkelDir->setEnabled(false);
+ }
}
void LDAPConfig::bondToNewRealm() {