summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ldapconfigbase.ui32
-rw-r--r--src/ldapmgr.cpp39
2 files changed, 66 insertions, 5 deletions
diff --git a/src/ldapconfigbase.ui b/src/ldapconfigbase.ui
index fb521d4..3e00b0f 100644
--- a/src/ldapconfigbase.ui
+++ b/src/ldapconfigbase.ui
@@ -157,6 +157,14 @@
<string>Delete</string>
</property>
</widget>
+ <widget class="TQPushButton" row="0" column="3" colspan="0">
+ <property name="name">
+ <cstring>user_buttonRefresh</cstring>
+ </property>
+ <property name="text">
+ <string>Refresh</string>
+ </property>
+ </widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="0">
@@ -413,6 +421,14 @@
<string>Delete</string>
</property>
</widget>
+ <widget class="TQPushButton" row="0" column="3" colspan="0">
+ <property name="name">
+ <cstring>group_buttonRefresh</cstring>
+ </property>
+ <property name="text">
+ <string>Refresh</string>
+ </property>
+ </widget>
<widget class="TQGroupBox" row="1" column="0" colspan="3">
<property name="name">
<cstring>groupGroupDetails</cstring>
@@ -603,6 +619,14 @@
<string>Delete</string>
</property>
</widget>
+ <widget class="TQPushButton" row="0" column="3" colspan="0">
+ <property name="name">
+ <cstring>machine_buttonRefresh</cstring>
+ </property>
+ <property name="text">
+ <string>Refresh</string>
+ </property>
+ </widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="0">
@@ -795,6 +819,14 @@
<string>Delete</string>
</property>
</widget>
+ <widget class="TQPushButton" row="0" column="3" colspan="0">
+ <property name="name">
+ <cstring>service_buttonRefresh</cstring>
+ </property>
+ <property name="text">
+ <string>Refresh</string>
+ </property>
+ </widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="0">
diff --git a/src/ldapmgr.cpp b/src/ldapmgr.cpp
index 28ae1ac..7261618 100644
--- a/src/ldapmgr.cpp
+++ b/src/ldapmgr.cpp
@@ -115,6 +115,11 @@ LDAPConfig::LDAPConfig(TQWidget *parent, const char *name, const TQStringList&)
connect(base->group_buttonDelete, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedGroup()));
connect(base->machine_buttonDelete, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedMachine()));
connect(base->service_buttonDelete, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedService()));
+
+ connect(base->user_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
+ connect(base->group_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
+ connect(base->machine_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
+ connect(base->service_buttonRefresh, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateAllInformation()));
load();
@@ -194,29 +199,33 @@ void LDAPConfig::save() {
}
void LDAPConfig::processLockouts() {
+ bool connected = (!(!m_ldapmanager));
+
TQListViewItem* lvi = base->user_list->selectedItem();
if (lvi) {
LDAPUserInfo user = selectedUser();
- base->user_buttonModify->setEnabled(true);
+ base->user_buttonModify->setEnabled(connected);
base->user_buttonDelete->setEnabled(!user.tde_builtin_account);
}
else {
base->user_buttonModify->setEnabled(false);
base->user_buttonDelete->setEnabled(false);
}
- base->user_buttonAdd->setEnabled(true);
+ base->user_buttonAdd->setEnabled(connected);
+ base->user_buttonRefresh->setEnabled(connected);
lvi = base->group_list->selectedItem();
if (lvi) {
LDAPGroupInfo group = selectedGroup();
- base->group_buttonModify->setEnabled(true);
+ base->group_buttonModify->setEnabled(connected);
base->group_buttonDelete->setEnabled(!group.tde_builtin_account);
}
else {
base->group_buttonModify->setEnabled(false);
base->group_buttonDelete->setEnabled(false);
}
- base->group_buttonAdd->setEnabled(true);
+ base->group_buttonAdd->setEnabled(connected);
+ base->group_buttonRefresh->setEnabled(connected);
lvi = base->machine_list->selectedItem();
if (lvi) {
@@ -232,6 +241,7 @@ void LDAPConfig::processLockouts() {
// Think about it...yes you can add the 'add' feature...kadmin 'ank --random-key host/HOSTNAME.FQDN'...
base->machine_buttonAdd->setEnabled(false);
base->machine_buttonModify->setEnabled(false);
+ base->machine_buttonRefresh->setEnabled(connected);
lvi = base->service_list->selectedItem();
if (lvi) {
@@ -241,10 +251,11 @@ void LDAPConfig::processLockouts() {
else {
base->service_buttonDelete->setEnabled(false);
}
- base->service_buttonAdd->setEnabled(true);
+ base->service_buttonAdd->setEnabled(connected);
// FIXME
// Disable service modify as it is not implemented
base->service_buttonModify->setEnabled(false);
+ base->service_buttonRefresh->setEnabled(connected);
}
void LDAPConfig::connectToRealm(const TQString& realm) {
@@ -271,6 +282,8 @@ void LDAPConfig::connectToRealm(const TQString& realm) {
updateAllInformation();
}
+
+ processLockouts();
}
void LDAPConfig::abortConnection() {
@@ -317,24 +330,40 @@ void LDAPConfig::updateAllInformation() {
}
int LDAPConfig::populateUsers() {
+ if (!m_ldapmanager) {
+ return -1;
+ }
+
int retcode;
m_userInfoList = m_ldapmanager->users(&retcode);
return retcode;
}
int LDAPConfig::populateGroups() {
+ if (!m_ldapmanager) {
+ return -1;
+ }
+
int retcode;
m_groupInfoList = m_ldapmanager->groups(&retcode);
return retcode;
}
int LDAPConfig::populateMachines() {
+ if (!m_ldapmanager) {
+ return -1;
+ }
+
int retcode;
m_machineInfoList = m_ldapmanager->machines(&retcode);
return retcode;
}
int LDAPConfig::populateServices() {
+ if (!m_ldapmanager) {
+ return -1;
+ }
+
int retcode;
m_serviceInfoList = m_ldapmanager->services(&retcode);
return retcode;