Fix user editing dialog

pull/1/head
Timothy Pearson 13 years ago
parent 6d3279772d
commit 9dc612fd76

@ -38,6 +38,14 @@
<property name="name"> <property name="name">
<cstring>detailsIcon</cstring> <cstring>detailsIcon</cstring>
</property> </property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget> </widget>
<widget class="TQLabel" row="0" column="1" colspan="1"> <widget class="TQLabel" row="0" column="1" colspan="1">
<property name="name"> <property name="name">

@ -33,6 +33,7 @@
#include <tqradiobutton.h> #include <tqradiobutton.h>
#include <tqcheckbox.h> #include <tqcheckbox.h>
#include <kdatetimewidget.h> #include <kdatetimewidget.h>
#include <kiconloader.h>
#include "ldapmgr.h" #include "ldapmgr.h"
#include "groupconfigdlg.h" #include "groupconfigdlg.h"
@ -49,6 +50,8 @@ GroupConfigDialog::GroupConfigDialog(LDAPGroupInfo group, LDAPConfig* parent, co
m_base->groupName->setEnabled(false); m_base->groupName->setEnabled(false);
} }
m_base->detailsIcon->setPixmap(SmallIcon("kdmconfig.png"));
connect(m_base->addToGroup, TQT_SIGNAL(clicked()), this, TQT_SLOT(addSelectedUserToGroup())); connect(m_base->addToGroup, TQT_SIGNAL(clicked()), this, TQT_SLOT(addSelectedUserToGroup()));
connect(m_base->removeFromGroup, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedUserFromGroup())); connect(m_base->removeFromGroup, TQT_SIGNAL(clicked()), this, TQT_SLOT(removeSelectedUserFromGroup()));
connect(m_base->groupName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts())); connect(m_base->groupName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts()));

@ -38,6 +38,7 @@
#include <kcombobox.h> #include <kcombobox.h>
#include <kmessagebox.h> #include <kmessagebox.h>
#include <klineedit.h> #include <klineedit.h>
#include <kiconloader.h>
#include <tdesu/process.h> #include <tdesu/process.h>
@ -84,6 +85,10 @@ LDAPConfig::LDAPConfig(TQWidget *parent, const char *name, const TQStringList&)
base->machine_name->setEnabled(false); base->machine_name->setEnabled(false);
base->machine_author->setEnabled(false); base->machine_author->setEnabled(false);
base->user_icon->setPixmap(SmallIcon("personal.png"));
base->group_icon->setPixmap(SmallIcon("kdmconfig.png"));
base->machine_icon->setPixmap(SmallIcon("system.png"));
connect(base->user_ldapRealm, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(connectToRealm(const TQString&))); connect(base->user_ldapRealm, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(connectToRealm(const TQString&)));
connect(base->group_ldapRealm, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(connectToRealm(const TQString&))); connect(base->group_ldapRealm, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(connectToRealm(const TQString&)));
connect(base->machine_ldapRealm, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(connectToRealm(const TQString&))); connect(base->machine_ldapRealm, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(connectToRealm(const TQString&)));
@ -457,7 +462,9 @@ void LDAPConfig::groupHighlighted() {
base->group_memberList->clear(); base->group_memberList->clear();
for ( TQStringList::Iterator it = group.userlist.begin(); it != group.userlist.end(); ++it ) { for ( TQStringList::Iterator it = group.userlist.begin(); it != group.userlist.end(); ++it ) {
LDAPUserInfo user = findUserByDistinguishedName(*it); LDAPUserInfo user = findUserByDistinguishedName(*it);
(void)new TQListViewItem(base->group_memberList, user.name, user.commonName, TQString("%1").arg(user.uid)); if (user.name != "") {
(void)new TQListViewItem(base->group_memberList, user.name, user.commonName, TQString("%1").arg(user.uid));
}
} }
processLockouts(); processLockouts();

@ -38,6 +38,14 @@
<property name="name"> <property name="name">
<cstring>detailsIcon</cstring> <cstring>detailsIcon</cstring>
</property> </property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget> </widget>
<widget class="TQLabel" row="0" column="1" colspan="1"> <widget class="TQLabel" row="0" column="1" colspan="1">
<property name="name"> <property name="name">
@ -54,7 +62,7 @@
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy> <sizepolicy>
<hsizetype>5</hsizetype> <hsizetype>5</hsizetype>
<vsizetype>4</vsizetype> <vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -90,6 +98,14 @@
<property name="name"> <property name="name">
<cstring>enabledIcon</cstring> <cstring>enabledIcon</cstring>
</property> </property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget> </widget>
<widget class="TQRadioButton" row="0" column="2" colspan="1"> <widget class="TQRadioButton" row="0" column="2" colspan="1">
<property name="name"> <property name="name">
@ -103,6 +119,14 @@
<property name="name"> <property name="name">
<cstring>disabledIcon</cstring> <cstring>disabledIcon</cstring>
</property> </property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget> </widget>
</grid> </grid>
</widget> </widget>
@ -141,7 +165,7 @@
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>Real Name*</string> <string>Display Name*</string>
</property> </property>
</widget> </widget>
<widget class="KLineEdit" row="2" column="2" colspan="3"> <widget class="KLineEdit" row="2" column="2" colspan="3">
@ -149,7 +173,24 @@
<cstring>realName</cstring> <cstring>realName</cstring>
</property> </property>
</widget> </widget>
<widget class="TQLabel" row="3" column="0" colspan="2"> <widget class="TQFrame" row="3" column="0" colspan="5">
<property name="name">
<cstring>unnamed_separator</cstring>
</property>
<property name="name">
<cstring>unnamed_separator</cstring>
</property>
<property name="minimumHeight">
<number>25</number>
</property>
<property name="frameShape">
<enum>HLine</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
</widget>
<widget class="TQLabel" row="4" column="0" colspan="2">
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
@ -157,7 +198,7 @@
<string>User ID</string> <string>User ID</string>
</property> </property>
</widget> </widget>
<widget class="KIntNumInput" row="3" column="2" colspan="3"> <widget class="KIntNumInput" row="4" column="2" colspan="3">
<property name="name"> <property name="name">
<cstring>UID</cstring> <cstring>UID</cstring>
</property> </property>
@ -168,7 +209,7 @@
<number>99999</number> <number>99999</number>
</property> </property>
</widget> </widget>
<widget class="TQLabel" row="4" column="0" colspan="2"> <widget class="TQLabel" row="5" column="0" colspan="2">
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
@ -176,12 +217,12 @@
<string>Primary Group</string> <string>Primary Group</string>
</property> </property>
</widget> </widget>
<widget class="KComboBox" row="4" column="2" colspan="3"> <widget class="KComboBox" row="5" column="2" colspan="3">
<property name="name"> <property name="name">
<cstring>primaryGroup</cstring> <cstring>primaryGroup</cstring>
</property> </property>
</widget> </widget>
<widget class="TQLabel" row="5" column="0" colspan="2"> <widget class="TQLabel" row="6" column="0" colspan="2">
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
@ -189,7 +230,7 @@
<string>Home Directory*</string> <string>Home Directory*</string>
</property> </property>
</widget> </widget>
<widget class="KURLRequester" row="5" column="2" colspan="3"> <widget class="KURLRequester" row="6" column="2" colspan="3">
<property name="name"> <property name="name">
<cstring>homeDirectory</cstring> <cstring>homeDirectory</cstring>
</property> </property>
@ -197,15 +238,15 @@
<number>18</number> <number>18</number>
</property> </property>
</widget> </widget>
<widget class="TQLabel" row="6" column="0" colspan="2"> <widget class="TQLabel" row="7" column="0" colspan="2">
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>Shell*</string> <string>Shell</string>
</property> </property>
</widget> </widget>
<widget class="KComboBox" row="6" column="2" colspan="3"> <widget class="KComboBox" row="7" column="2" colspan="3">
<property name="name"> <property name="name">
<cstring>shell</cstring> <cstring>shell</cstring>
</property> </property>
@ -244,31 +285,160 @@
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="TQLabel" row="0" column="0" colspan="1"> <widget class="TQLabel" row="0" column="0" colspan="1">
<property name="name">
<cstring>userIcon</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget>
<widget class="TQLabel" row="0" column="1" colspan="4">
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>Given Name</string> <string>Detailed User Information</string>
</property> </property>
</widget> </widget>
<widget class="KLineEdit" row="0" column="1" colspan="1"> <widget class="TQLabel" row="1" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>First Name</string>
</property>
</widget>
<widget class="KLineEdit" row="1" column="2" colspan="1">
<property name="name"> <property name="name">
<cstring>givenName</cstring> <cstring>givenName</cstring>
</property> </property>
</widget> </widget>
<widget class="TQLabel" row="0" column="2" colspan="1"> <widget class="TQLabel" row="1" column="3" colspan="1">
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<property name="text"> <property name="text">
<string>Surname*</string> <string>Initials</string>
</property> </property>
</widget> </widget>
<widget class="KLineEdit" row="0" column="3" colspan="1"> <widget class="KLineEdit" row="1" column="4" colspan="1">
<property name="name">
<cstring>initials</cstring>
</property>
</widget>
<widget class="TQLabel" row="2" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Last Name*</string>
</property>
</widget>
<widget class="KLineEdit" row="2" column="2" colspan="3">
<property name="name"> <property name="name">
<cstring>surName</cstring> <cstring>surName</cstring>
</property> </property>
</widget> </widget>
<widget class="TQLabel" row="3" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Title</string>
</property>
</widget>
<widget class="KLineEdit" row="3" column="2" colspan="3">
<property name="name">
<cstring>title</cstring>
</property>
</widget>
<widget class="TQLabel" row="4" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Description</string>
</property>
</widget>
<widget class="KLineEdit" row="4" column="2" colspan="3">
<property name="name">
<cstring>description</cstring>
</property>
</widget>
<widget class="TQLabel" row="5" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Office</string>
</property>
</widget>
<widget class="KLineEdit" row="5" column="2" colspan="3">
<property name="name">
<cstring>office</cstring>
</property>
</widget>
<widget class="TQFrame" row="6" column="0" colspan="5">
<property name="name">
<cstring>unnamed_separator</cstring>
</property>
<property name="name">
<cstring>unnamed_separator</cstring>
</property>
<property name="minimumHeight">
<number>25</number>
</property>
<property name="frameShape">
<enum>HLine</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
</widget>
<widget class="TQLabel" row="7" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Telephone Number</string>
</property>
</widget>
<widget class="KLineEdit" row="7" column="2" colspan="3">
<property name="name">
<cstring>telephoneNumber</cstring>
</property>
</widget>
<widget class="TQLabel" row="8" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Facsimile Number</string>
</property>
</widget>
<widget class="KLineEdit" row="8" column="2" colspan="3">
<property name="name">
<cstring>faxNumber</cstring>
</property>
</widget>
<widget class="TQLabel" row="9" column="0" colspan="2">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Email Address</string>
</property>
</widget>
<widget class="KLineEdit" row="9" column="2" colspan="3">
<property name="name">
<cstring>email</cstring>
</property>
</widget>
<spacer row="10" column="0"> <spacer row="10" column="0">
<property name="name" stdset="0"> <property name="name" stdset="0">
<cstring>Spacer20</cstring> <cstring>Spacer20</cstring>
@ -303,6 +473,14 @@
<property name="name"> <property name="name">
<cstring>groupsIcon</cstring> <cstring>groupsIcon</cstring>
</property> </property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget> </widget>
<widget class="TQLabel" row="0" column="1" colspan="1"> <widget class="TQLabel" row="0" column="1" colspan="1">
<property name="name"> <property name="name">
@ -382,6 +560,14 @@
<property name="name"> <property name="name">
<cstring>passwordIcon</cstring> <cstring>passwordIcon</cstring>
</property> </property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>4</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget> </widget>
<widget class="TQLabel" row="0" column="1" colspan="1"> <widget class="TQLabel" row="0" column="1" colspan="1">
<property name="name"> <property name="name">
@ -430,7 +616,7 @@
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy> <sizepolicy>
<hsizetype>5</hsizetype> <hsizetype>5</hsizetype>
<vsizetype>4</vsizetype> <vsizetype>5</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -528,6 +714,14 @@
<property name="text"> <property name="text">
<string>Require new password after:</string> <string>Require new password after:</string>
</property> </property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>5</hsizetype>
<vsizetype>5</vsizetype>
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
</widget> </widget>
<widget class="TQSpinBox" row="0" column="2" colspan="1"> <widget class="TQSpinBox" row="0" column="2" colspan="1">
<property name="name"> <property name="name">

@ -34,6 +34,7 @@
#include <tqcheckbox.h> #include <tqcheckbox.h>
#include <kdatetimewidget.h> #include <kdatetimewidget.h>
#include <kpassdlg.h> #include <kpassdlg.h>
#include <kiconloader.h>
#include "ldapmgr.h" #include "ldapmgr.h"
#include "userconfigdlg.h" #include "userconfigdlg.h"
@ -53,6 +54,13 @@ UserConfigDialog::UserConfigDialog(LDAPUserInfo user, LDAPConfig* parent, const
} }
m_base->lastChanged->setEnabled(false); m_base->lastChanged->setEnabled(false);
m_base->detailsIcon->setPixmap(SmallIcon("personal.png"));
m_base->enabledIcon->setPixmap(SmallIcon("decrypted.png"));
m_base->disabledIcon->setPixmap(SmallIcon("encrypted.png"));
m_base->userIcon->setPixmap(SmallIcon("personal.png"));
m_base->groupsIcon->setPixmap(SmallIcon("kdmconfig.png"));
m_base->passwordIcon->setPixmap(SmallIcon("password.png"));
connect(m_base->loginName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts())); connect(m_base->loginName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts()));
connect(m_base->realName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts())); connect(m_base->realName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts()));
connect(m_base->surName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts())); connect(m_base->surName, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(processLockouts()));
@ -63,9 +71,6 @@ UserConfigDialog::UserConfigDialog(LDAPUserInfo user, LDAPConfig* parent, const
connect(m_base->requirePasswordMinAge, TQT_SIGNAL(clicked()), this, TQT_SLOT(processLockouts())); connect(m_base->requirePasswordMinAge, TQT_SIGNAL(clicked()), this, TQT_SLOT(processLockouts()));
connect(m_base->primaryGroup, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(processLockouts())); connect(m_base->primaryGroup, TQT_SIGNAL(activated(const TQString&)), this, TQT_SLOT(processLockouts()));
// Update fields
// KPasswordEdit* passwordEntry;
if (m_user.status == KRB5_DISABLED_ACCOUNT) { if (m_user.status == KRB5_DISABLED_ACCOUNT) {
m_base->userStatusEnabled->setChecked(false); m_base->userStatusEnabled->setChecked(false);
m_base->userStatusDisabled->setChecked(true); m_base->userStatusDisabled->setChecked(true);
@ -95,7 +100,6 @@ UserConfigDialog::UserConfigDialog(LDAPUserInfo user, LDAPConfig* parent, const
item->setOn(group.userlist.contains(m_user.distinguishedName)); item->setOn(group.userlist.contains(m_user.distinguishedName));
} }
// m_base->passwordEntry;
m_base->lastChanged->setText(m_user.password_last_changed.toString(TQt::TextDate)); m_base->lastChanged->setText(m_user.password_last_changed.toString(TQt::TextDate));
if (m_user.password_expires) { if (m_user.password_expires) {
m_base->passwordExpireEnabled->setChecked(true); m_base->passwordExpireEnabled->setChecked(true);
@ -116,6 +120,13 @@ UserConfigDialog::UserConfigDialog(LDAPUserInfo user, LDAPConfig* parent, const
// User information // User information
m_base->givenName->setText(m_user.givenName); m_base->givenName->setText(m_user.givenName);
m_base->surName->setText(m_user.surName); m_base->surName->setText(m_user.surName);
m_base->initials->setText(m_user.initials);
m_base->title->setText(m_user.title);
m_base->description->setText(m_user.description);
m_base->office->setText(m_user.deliveryOffice);
m_base->telephoneNumber->setText(m_user.telephoneNumber);
m_base->faxNumber->setText(m_user.faxNumber);
m_base->email->setText(m_user.email);
processLockouts(); processLockouts();
} }
@ -167,6 +178,13 @@ void UserConfigDialog::slotOk() {
// User information // User information
m_user.givenName = m_base->givenName->text(); m_user.givenName = m_base->givenName->text();
m_user.surName = m_base->surName->text(); m_user.surName = m_base->surName->text();
m_user.initials = m_base->initials->text();
m_user.title = m_base->title->text();
m_user.description = m_base->description->text();
m_user.deliveryOffice = m_base->office->text();
m_user.telephoneNumber = m_base->telephoneNumber->text();
m_user.faxNumber = m_base->faxNumber->text();
m_user.email = m_base->email->text();
// Special handler for new group // Special handler for new group
if (m_user.distinguishedName == "") { if (m_user.distinguishedName == "") {

Loading…
Cancel
Save