Import ldap login dialog and start adding ui bases to control module

pull/1/head
Timothy Pearson 12 years ago
parent 6b705421fa
commit a63d48d3ea

@ -4,7 +4,7 @@ METASOURCES = AUTO
# Install this plugin in the KDE modules directory
kde_module_LTLIBRARIES = kcm_ldapmanager.la
kcm_ldapmanager_la_SOURCES = ldap.cpp ldapconfigbase.ui
kcm_ldapmanager_la_SOURCES = ldap.cpp ldapconfigbase.ui userconfigbase.ui groupconfigbase.ui libtdeldap.cpp ldaplogindlgbase.ui ldaplogindlg.cpp ldappasswddlg.cpp
kcm_ldapmanager_la_LIBADD = -lkio $(LIB_TDEUI)
kcm_ldapmanager_la_LDFLAGS = -avoid-version -module -no-undefined \
$(all_libraries)

@ -70,7 +70,7 @@
</widget>
<widget class="TQLayoutWidget" row="2" column="0" colspan="3">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_layoutwidget</cstring>
</property>
<grid>
<property name="name">
@ -99,7 +99,7 @@
</widget>
<widget class="TQLayoutWidget" row="1" column="1" colspan="1">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_layoutwidget</cstring>
</property>
<grid>
<property name="name">
@ -107,7 +107,7 @@
</property>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
<string>addToGroup</string>
<cstring>addToGroup</cstring>
</property>
<property name="text">
<string>Add</string>
@ -115,7 +115,7 @@
</widget>
<widget class="TQPushButton" row="1" column="0" colspan="1">
<property name="name">
<string>removeFromGroup</string>
<cstring>removeFromGroup</cstring>
</property>
<property name="text">
<string>Remove</string>

@ -36,48 +36,63 @@
#include "ldap.h"
typedef KGenericFactory<ldap, TQWidget> ldapFactory;
typedef KGenericFactory<LDAPConfig, TQWidget> LDAPConfigFactory;
K_EXPORT_COMPONENT_FACTORY( kcm_ldapmanager, ldapFactory("kcmldapmanager"))
K_EXPORT_COMPONENT_FACTORY( kcm_ldapmanager, LDAPConfigFactory("kcmldapmanager"))
ldap::ldap(TQWidget *parent, const char *name, const TQStringList&)
LDAPConfig::LDAPConfig(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());
base = new LDAPConfigBase(this);
layout->add(base);
base->user_list->setAllColumnsShowFocus(true);
base->user_list->setFullWidth(true);
base->group_list->setAllColumnsShowFocus(true);
base->group_list->setFullWidth(true);
base->group_memberList->setAllColumnsShowFocus(true);
base->group_memberList->setFullWidth(true);
base->machine_list->setAllColumnsShowFocus(true);
base->machine_list->setFullWidth(true);
load();
KAboutData* about = new KAboutData("ldap", I18N_NOOP("TDE LDAP Manager"), "0.1",
I18N_NOOP("TDE LDAP Manager Control Panel Module"),
KAboutData* about = new KAboutData("ldap", I18N_NOOP("TDE LDAP Realm Manager"), "0.1",
I18N_NOOP("TDE LDAP Realm Manager Control Panel Module"),
KAboutData::License_GPL,
I18N_NOOP("(c) 2012 Timothy Pearson"), 0, 0);
about->addAuthor("Timothy Pearson", 0, "kb9vqf@pearsoncomputing.net");
setAboutData( about );
processLockouts();
};
ldap::~ldap() {
LDAPConfig::~LDAPConfig() {
}
void ldap::load() {
void LDAPConfig::load() {
kgs = new KGlobalSettings();
KStandardDirs *ksd = new KStandardDirs();
}
void ldap::defaults() {
void LDAPConfig::defaults() {
}
void ldap::save() {
void LDAPConfig::save() {
}
int ldap::buttons() {
void LDAPConfig::processLockouts() {
//
}
int LDAPConfig::buttons() {
return KCModule::Apply|KCModule::Help;
}
TQString ldap::quickHelp() const
TQString LDAPConfig::quickHelp() const
{
return i18n("This module configures which LDAP realms TDE uses for authentication.");
return i18n("This module manages users, groups, and machines in LDAP realms.");
}

@ -32,13 +32,13 @@
#include "ldapconfigbase.h"
class ldap: public KCModule
class LDAPConfig: public KCModule
{
Q_OBJECT
public:
ldap( TQWidget *parent=0, const char *name=0, const TQStringList& = TQStringList() );
~ldap();
LDAPConfig( TQWidget *parent=0, const char *name=0, const TQStringList& = TQStringList() );
~LDAPConfig();
virtual void load();
virtual void save();
@ -47,9 +47,14 @@ class ldap: public KCModule
virtual TQString quickHelp() const;
virtual const KAboutData *aboutData() const { return myAboutData; };
private slots:
void processLockouts();
private:
KAboutData *myAboutData;
KGlobalSettings *kgs;
LDAPConfigBase *base;
};
#endif

@ -14,7 +14,7 @@
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_grid1</cstring>
</property>
<widget class="TQTabWidget" row="0" column="0">
<property name="name">
@ -32,7 +32,7 @@
</attribute>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_grid2</cstring>
</property>
<widget class="TQLabel" row="0" column="0" colspan="0">
<property name="name">
@ -41,7 +41,7 @@
</widget>
<widget class="TQLabel" row="0" column="1" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label1</cstring>
</property>
<property name="text">
<string>User Accounts in LDAP Realm</string>
@ -119,7 +119,7 @@
</widget>
<widget class="TQLayoutWidget" row="2" column="0" colspan="4">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_layoutwidget1</cstring>
</property>
<grid>
<widget class="TQLayoutWidget" row="0" column="0">
@ -128,7 +128,7 @@
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_grid3</cstring>
</property>
<widget class="TQPushButton" row="0" column="0" colspan="0">
<property name="name">
@ -165,11 +165,11 @@
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_grid4</cstring>
</property>
<widget class="TQLabel" row="0" column="0" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label2</cstring>
</property>
<property name="text">
<string>Login Name:</string>
@ -185,7 +185,7 @@
</widget>
<widget class="TQLabel" row="1" column="0" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label3</cstring>
</property>
<property name="text">
<string>UID:</string>
@ -201,7 +201,7 @@
</widget>
<widget class="TQLabel" row="2" column="0" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label4</cstring>
</property>
<property name="text">
<string>Primary Group:</string>
@ -217,7 +217,7 @@
</widget>
<widget class="TQLabel" row="0" column="2" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label5</cstring>
</property>
<property name="text">
<string>Real Name:</string>
@ -233,7 +233,7 @@
</widget>
<widget class="TQLabel" row="1" column="2" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label6</cstring>
</property>
<property name="text">
<string>Status:</string>
@ -249,7 +249,7 @@
</widget>
<widget class="TQLabel" row="2" column="2" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label7</cstring>
</property>
<property name="text">
<string>Secondary Groups:</string>
@ -296,7 +296,7 @@
</attribute>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_grid5</cstring>
</property>
<widget class="TQLabel" row="0" column="0" colspan="0">
<property name="name">
@ -305,7 +305,7 @@
</widget>
<widget class="TQLabel" row="0" column="1" colspan="0">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_label8</cstring>
</property>
<property name="text">
<string>Groups in LDAP Realm</string>
@ -372,7 +372,7 @@
</widget>
<widget class="TQLayoutWidget" row="2" column="0" colspan="4">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_layoutwidget2</cstring>
</property>
<grid>
<widget class="TQLayoutWidget" row="0" column="0">
@ -381,7 +381,7 @@
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_grid6</cstring>
</property>
<widget class="TQPushButton" row="0" column="0" colspan="0">
<property name="name">
@ -559,7 +559,7 @@
</widget>
<widget class="TQLayoutWidget" row="2" column="0" colspan="4">
<property name="name">
<cstring>unnamed</cstring>
<cstring>unnamed_layoutwidget3</cstring>
</property>
<grid>
<widget class="TQLayoutWidget" row="0" column="0">

@ -0,0 +1,45 @@
/***************************************************************************
* Copyright (C) 2012 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <tqstringlist.h>
#include <tqlabel.h>
#include <tqmap.h>
#include <kapplication.h>
#include <ksimpleconfig.h>
#include <klocale.h>
#include <kdebug.h>
#include <kstandarddirs.h>
#include <kiconloader.h>
#include <dcopclient.h>
#include <kprocess.h>
#include "ldaplogindlg.h"
LDAPLogin::LDAPLogin(TQWidget *parent, const char *name ) : LDAPLoginDlg(parent,name) {
px_introSidebar->setPixmap(UserIcon("step3.png"));
}
LDAPLogin::~LDAPLogin(){
//
}
#include "ldaplogindlg.moc"

@ -0,0 +1,39 @@
/***************************************************************************
* Copyright (C) 2012 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef LDAPLOGIN_H
#define LDAPLOGIN_H
#include "ldaplogindlgbase.h"
class TQStringList;
/**LDAP login dialog
*@author Timothy Pearson
*/
class LDAPLogin : public LDAPLoginDlg {
Q_OBJECT
public:
LDAPLogin(TQWidget *parent=0, const char *name=0);
~LDAPLogin();
};
#endif

@ -0,0 +1,129 @@
<!DOCTYPE UI><UI version="3.0" stdsetdef="1">
<class>LDAPLoginDlg</class>
<widget class="TQWidget">
<property name="name">
<cstring>LDAPLoginDlg</cstring>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQLabel" row="0" column="0" rowspan="9" colspan="1">
<property name="name">
<cstring>px_introSidebar</cstring>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>0</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>170</width>
<height>430</height>
</size>
</property>
<property name="frameShape">
<enum>Panel</enum>
</property>
<property name="frameShadow">
<enum>Sunken</enum>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
<property name="indent">
<number>0</number>
</property>
</widget>
<widget class="TQLabel" row="0" column="1" colspan="2">
<property name="name">
<cstring>yad_string</cstring>
</property>
<property name="text">
<string>&lt;h3&gt;You're almost done!&lt;/h3&gt;</string>
</property>
</widget>
<widget class="TQLabel" row="1" column="1" colspan="2">
<property name="name">
<cstring>passprompt</cstring>
</property>
<property name="text">
<string>Please provide LDAP realm administrator credentials below to complete the bonding process</string>
</property>
</widget>
<widget class="TQLabel" row="2" column="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Username</string>
</property>
</widget>
<widget class="KLineEdit" row="2" column="2">
<property name="name">
<cstring>ldapAdminUsername</cstring>
</property>
</widget>
<widget class="TQLabel" row="3" column="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Password</string>
</property>
</widget>
<widget class="KPasswordEdit" row="3" column="2">
<property name="name">
<cstring>ldapAdminPassword</cstring>
</property>
</widget>
<widget class="TQLabel" row="4" column="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>LDAP Realm</string>
</property>
</widget>
<widget class="KLineEdit" row="4" column="2">
<property name="name">
<cstring>ldapAdminRealm</cstring>
</property>
</widget>
<spacer row="5" column="1">
<property name="name">
<cstring>Spacer6</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Fixed</enum>
</property>
<property name="sizeHint">
<size>
<width>20</width>
<height>30</height>
</size>
</property>
</spacer>
<spacer row="7" column="1">
<property name="name">
<cstring>Spacer5</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<property name="sizeType">
<enum>Expanding</enum>
</property>
</spacer>
</grid>
</widget>
<layoutdefaults spacing="3" margin="6"/>
<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/>
</UI>

@ -0,0 +1,49 @@
/***************************************************************************
* Copyright (C) 2012 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <klocale.h>
#include <klineedit.h>
#include <ktextedit.h>
#include <knuminput.h>
#include <kactionselector.h>
#include <tqlistbox.h>
#include <kpushbutton.h>
#include <tqpixmap.h>
#include <tqiconset.h>
#include <tqlabel.h>
#include "ldappasswddlg.h"
LDAPPasswordDialog::LDAPPasswordDialog(TQWidget* parent, const char* name)
: KDialogBase(parent, name, true, i18n("LDAP Authentication"), Ok|Cancel, Ok, true)
{
m_base = new LDAPLogin(this);
m_base->px_introSidebar->hide();
m_base->yad_string->hide();
setMainWidget(m_base);
}
void LDAPPasswordDialog::slotOk() {
accept();
}
#include "ldappasswddlg.moc"

@ -0,0 +1,42 @@
/***************************************************************************
* Copyright (C) 2012 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _LDAPPASSWORDDIALOG_H_
#define _LDAPPASSWORDDIALOG_H_
#include <kdialogbase.h>
#include "ldaplogindlg.h"
class LDAPPasswordDialog : public KDialogBase
{
Q_OBJECT
public:
LDAPPasswordDialog(TQWidget* parent = 0, const char* name = 0);
public slots:
void slotOk();
public:
LDAPLogin *m_base;
};
#endif

@ -0,0 +1,72 @@
/***************************************************************************
* Copyright (C) 2012 by Timothy Pearson *
* kb9vqf@pearsoncomputing.net *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _LIBTDELDAP_H_
#define _LIBTDELDAP_H_
#include <unistd.h>
#include <tqstring.h>
#include <tqdatetime.h>
#include <tqvaluelist.h>
enum LDAPUserStatus {
USER_STATUS_ENABLED,
USER_STATUS_DISABLED
};
typedef TQValueList<uid_t> UserList;
typedef TQValueList<gid_t> GroupList;
class LDAPUserInfo
{
public:
TQString name;
uid_t uid;
TQString shell;
TQString homedir;
gid_t primary_gid;
GroupList grouplist;
LDAPUserStatus status;
TQDate password_last_changed;
bool password_expires;
TQDate password_expiration;
bool password_ages;
int new_password_interval;
int new_password_warn_interval;
int new_password_lockout_delay;
bool password_has_minimum_age;
int password_minimum_age;
TQString realName;
TQString organization;
// FIXME
// Add other attributes (cubicle, phone number, etc)
};
class LDAPGroupInfo
{
public:
TQString name;
gid_t gid;
UserList userlist;
};
#endif // _LIBTDELDAP_H_

@ -60,10 +60,10 @@
</sizepolicy>
</property>
<property name="frameShape">
<enum>None</enum>
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>None</enum>
<enum>Plain</enum>
</property>
<property name="title">
<string></string>
@ -194,7 +194,7 @@
<cstring>homeDirectory</cstring>
</property>
<property name="mode">
<cstring>Directory</cstring>
<number>18</number>
</property>
</widget>
<widget class="TQLabel" row="5" column="0" colspan="2">
@ -389,7 +389,7 @@
<enum>NoFrame</enum>
</property>
<property name="frameShadow">
<enum>None</enum>
<enum>Plain</enum>
</property>
<property name="title">
<string></string>

Loading…
Cancel
Save