summaryrefslogtreecommitdiff
path: root/core/settings/security/multiauthconfig.h
Unidiff
Diffstat (limited to 'core/settings/security/multiauthconfig.h') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/security/multiauthconfig.h141
1 files changed, 141 insertions, 0 deletions
diff --git a/core/settings/security/multiauthconfig.h b/core/settings/security/multiauthconfig.h
new file mode 100644
index 0000000..ffe920f
--- a/dev/null
+++ b/core/settings/security/multiauthconfig.h
@@ -0,0 +1,141 @@
1/**
2 * \file multiauthconfig.h
3 * \brief Configuration GUI for Opie multiauth. framework, login and sync
4 * \author Clément Séveillac (clement . seveillac (at) via . ecp . fr)
5 */
6/*
7 =. This file is part of the Opie Project
8 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
9 .>+-=
10 _;:, .> :=|. This library is free software; you can
11.> <`_, > . <= redistribute it and/or modify it under
12:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
13.="- .-=="i, .._ License as published by the Free Software
14 - . .-<_> .<> Foundation; either version 2 of the License,
15 ._= =} : or (at your option) any later version.
16 .%`+i> _;_.
17 .i_,=:_. -<s. This library is distributed in the hope that
18 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
19 : .. .:, . . . without even the implied warranty of
20 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
21 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.= = ; Library General Public License for more
23++= -. .` .: details.
24 : = ...= . :.=-
25 -. .:....=;==+<; You should have received a copy of the GNU
26 -_. . . )=. = Library General Public License along with
27 -- :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA.
31
32*/
33
34#ifndef MULTIAUTHCONFIG_H
35#define MULTIAUTHCONFIG_H
36
37#include <opie2/multiauthplugininterface.h>
38#include <opie2/multiauthcommon.h>
39
40/* OPIE */
41#include <opie2/otabwidget.h>
42
43/* QT */
44#include <qdialog.h>
45#include <qwidget.h>
46#include <qcheckbox.h>
47#include <qspinbox.h>
48#include <qpe/config.h>
49#include <qlistview.h>
50#include <qmap.h>
51#include <qcombobox.h>
52#include <qpushbutton.h>
53#include <qmessagebox.h>
54#include <qtextstream.h>
55
56/* UI */
57#include "syncbase.h"
58#include "loginbase.h"
59
60
61/// the "misc" configuration tab, about general Opie Multiauth settings
62class MultiauthGeneralConfig : public QWidget
63{
64 Q_OBJECT
65public:
66 MultiauthGeneralConfig(QWidget * parent, const char * name);
67 ~MultiauthGeneralConfig();
68protected:
69 QCheckBox *onStart, *onResume, *noProtectConfig, *explanScreens, *allowBypass;
70 QSpinBox *nbSuccessMin;
71private:
72 friend class MultiauthConfig;
73private slots:
74 void checkBypass();
75 void checkScreens();
76};
77
78/// the whole configuration dialog
79class MultiauthConfig : public QDialog
80{
81 Q_OBJECT
82
83public:
84 MultiauthConfig();
85 virtual ~MultiauthConfig();
86 void writeConfig();
87 QList<Opie::Security::MultiauthConfigWidget> configWidgetList;
88
89protected slots:
90 void pluginsChanged();
91 void moveSelectedUp();
92 void moveSelectedDown();
93
94private slots:
95 // Login and Sync stuff
96 void setSyncNet(const QString&);
97 void changeLoginName(int);
98 void toggleAutoLogin(bool);
99 void restoreDefaults();
100 void insertDefaultRanges();
101 void deleteListEntry();
102
103private:
104 /// the widget holding all the tabs (or pages)
105 Opie::Ui::OTabWidget *m_mainTW;
106 /// list of authentication plugins in the "Plugins" page
107 QListView *m_pluginListView;
108 QStringList m_allPlugins, m_excludePlugins;
109 QMap<QString,QCheckListItem*> m_plugins;
110 /// plugin list page
111 QWidget *m_pluginListWidget;
112 /// misc config page
113 MultiauthGeneralConfig *m_generalConfig;
114 /// login (root / ...) choice page
115 LoginBase *m_loginWidget;
116 /// synchronization settings page
117 SyncBase *m_syncWidget;
118
119 int m_nbSuccessReq;
120 bool m_plugins_changed;
121
122 void readConfig();
123 void loadPlugins();
124
125 // Login and Sync stuff
126 void loadUsers();
127 bool telnetAvailable() const;
128 bool sshAvailable() const;
129 void updateGUI();
130
131 static void parseNet(const QString& sn,int& auth_peer,int& auth_peer_bits);
132 void selectNet(int auth_peer,int auth_peer_bits,bool update);
133
134
135 bool autoLogin;
136 QString autoLoginName;
137};
138
139
140#endif // MULTIAUTHCONFIG_H
141