summaryrefslogtreecommitdiff
path: root/noncore/securityplugins/pin
Unidiff
Diffstat (limited to 'noncore/securityplugins/pin') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/securityplugins/pin/pin.cpp17
-rw-r--r--noncore/securityplugins/pin/pin.h4
-rw-r--r--noncore/securityplugins/pin/pinConfigWidget.cpp6
-rw-r--r--noncore/securityplugins/pin/pinConfigWidget.h16
-rw-r--r--noncore/securityplugins/pin/pinpluginimpl.cpp3
-rw-r--r--noncore/securityplugins/pin/pinpluginimpl.h5
6 files changed, 29 insertions, 22 deletions
diff --git a/noncore/securityplugins/pin/pin.cpp b/noncore/securityplugins/pin/pin.cpp
index 37dc5be..c21ffcd 100644
--- a/noncore/securityplugins/pin/pin.cpp
+++ b/noncore/securityplugins/pin/pin.cpp
@@ -41,8 +41,11 @@
41 41
42extern "C" char *crypt(const char *key, const char *salt); 42extern "C" char *crypt(const char *key, const char *salt);
43 43
44using Opie::Security::MultiauthConfigWidget;
45using Opie::Security::MultiauthPluginObject;
46
44/// set to TRUE when we press the 'Skip' button 47/// set to TRUE when we press the 'Skip' button
45bool isSkip = FALSE; 48static bool isSkip = FALSE;
46 49
47/// PIN input graphical widget. 50/// PIN input graphical widget.
48/** 51/**
@@ -232,10 +235,10 @@ QString PinPlugin::getPIN( const QString& prompt )
232{ 235{
233 PinDlg pd(0,0,TRUE); 236 PinDlg pd(0,0,TRUE);
234 pd.pinD->setPrompt( prompt ); 237 pd.pinD->setPrompt( prompt );
235 238
236 pd.showMaximized(); 239 pd.showMaximized();
237 int r = pd.exec(); 240 int r = pd.exec();
238 241
239 if ( r == QDialog::Accepted ) { 242 if ( r == QDialog::Accepted ) {
240 if (pd.pinD->text.isEmpty()) 243 if (pd.pinD->text.isEmpty())
241 return ""; 244 return "";
@@ -302,13 +305,13 @@ int PinPlugin::authenticate()
302 PinDlg pd(0,0,TRUE,TRUE); 305 PinDlg pd(0,0,TRUE,TRUE);
303 pd.reset(); 306 pd.reset();
304 pd.exec(); 307 pd.exec();
305 308
306 // analyse the result 309 // analyse the result
307 if (isSkip == TRUE) 310 if (isSkip == TRUE)
308 return MultiauthPluginObject::Skip; 311 return MultiauthPluginObject::Skip;
309 else if (verify(pd.pinD->text, hashedPin)) 312 else if (verify(pd.pinD->text, hashedPin))
310 return MultiauthPluginObject::Success; 313 return MultiauthPluginObject::Success;
311 else 314 else
312 return MultiauthPluginObject::Failure; 315 return MultiauthPluginObject::Failure;
313 } 316 }
314 owarn << "No PIN has been defined! We consider it as a successful authentication though." << oendl; 317 owarn << "No PIN has been defined! We consider it as a successful authentication though." << oendl;
@@ -331,10 +334,10 @@ QString PinPlugin::pixmapNameConfig() const {
331/// returns a PinConfigWidget 334/// returns a PinConfigWidget
332MultiauthConfigWidget * PinPlugin::configWidget(QWidget * parent) { 335MultiauthConfigWidget * PinPlugin::configWidget(QWidget * parent) {
333 PinConfigWidget * pinw = new PinConfigWidget(parent, "PIN configuration widget"); 336 PinConfigWidget * pinw = new PinConfigWidget(parent, "PIN configuration widget");
334 337
335 connect(pinw->changePIN, SIGNAL( clicked() ), this, SLOT( changePIN() )); 338 connect(pinw->changePIN, SIGNAL( clicked() ), this, SLOT( changePIN() ));
336 connect(pinw->clearPIN, SIGNAL( clicked() ), this, SLOT( clearPIN() )); 339 connect(pinw->clearPIN, SIGNAL( clicked() ), this, SLOT( clearPIN() ));
337 340
338 return pinw; 341 return pinw;
339} 342}
340 343
diff --git a/noncore/securityplugins/pin/pin.h b/noncore/securityplugins/pin/pin.h
index 6cd328a..1832210 100644
--- a/noncore/securityplugins/pin/pin.h
+++ b/noncore/securityplugins/pin/pin.h
@@ -43,13 +43,13 @@
43/** 43/**
44 * The plugin itself, implementing the main authenticate() function. 44 * The plugin itself, implementing the main authenticate() function.
45 */ 45 */
46class PinPlugin : public QObject, public MultiauthPluginObject { 46class PinPlugin : public QObject, public Opie::Security::MultiauthPluginObject {
47 47
48 Q_OBJECT 48 Q_OBJECT
49 49
50public: 50public:
51 int authenticate(); 51 int authenticate();
52 MultiauthConfigWidget * configWidget(QWidget * parent); 52 Opie::Security::MultiauthConfigWidget * configWidget(QWidget * parent);
53 QString pixmapNameConfig() const; 53 QString pixmapNameConfig() const;
54 QString pixmapNameWidget() const; 54 QString pixmapNameWidget() const;
55 QString pluginName() const; 55 QString pluginName() const;
diff --git a/noncore/securityplugins/pin/pinConfigWidget.cpp b/noncore/securityplugins/pin/pinConfigWidget.cpp
index 53e1a20..b34db8b 100644
--- a/noncore/securityplugins/pin/pinConfigWidget.cpp
+++ b/noncore/securityplugins/pin/pinConfigWidget.cpp
@@ -5,6 +5,8 @@
5 5
6#include "pinConfigWidget.h" 6#include "pinConfigWidget.h"
7 7
8using Opie::Security::MultiauthConfigWidget;
9
8PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN configuration widget") 10PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN configuration widget")
9 : MultiauthConfigWidget(parent, name) 11 : MultiauthConfigWidget(parent, name)
10{ 12{
@@ -12,7 +14,7 @@ PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN co
12 baseLayout->setSpacing(11); 14 baseLayout->setSpacing(11);
13 baseLayout->setMargin(11); 15 baseLayout->setMargin(11);
14 baseLayout->setAlignment( Qt::AlignTop ); 16 baseLayout->setAlignment( Qt::AlignTop );
15 17
16 QGroupBox * configBox = new QGroupBox(0, Qt::Vertical, tr("Configure your PIN here"), this); 18 QGroupBox * configBox = new QGroupBox(0, Qt::Vertical, tr("Configure your PIN here"), this);
17 baseLayout->addWidget(configBox); 19 baseLayout->addWidget(configBox);
18 QVBoxLayout *boxLayout = new QVBoxLayout( configBox->layout() ); 20 QVBoxLayout *boxLayout = new QVBoxLayout( configBox->layout() );
@@ -27,7 +29,7 @@ PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN co
27 buttonLayout->addWidget(changePIN); 29 buttonLayout->addWidget(changePIN);
28 buttonLayout->addWidget(clearPIN); 30 buttonLayout->addWidget(clearPIN);
29 boxLayout->addLayout(buttonLayout); 31 boxLayout->addLayout(buttonLayout);
30 32
31} 33}
32 34
33/// nothing to do 35/// nothing to do
diff --git a/noncore/securityplugins/pin/pinConfigWidget.h b/noncore/securityplugins/pin/pinConfigWidget.h
index 3242ad0..6d5edff 100644
--- a/noncore/securityplugins/pin/pinConfigWidget.h
+++ b/noncore/securityplugins/pin/pinConfigWidget.h
@@ -7,24 +7,24 @@
7 =. This file is part of the Opie Project 7 =. This file is part of the Opie Project
8 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org> 8 .=l. Copyright (C) 2004 Opie Developer Team <opie-devel@handhelds.org>
9 .>+-= 9 .>+-=
10 _;:, .> :=|. This library is free software; you can 10 _;:, .> :=|. This library is free software; you can
11.> <`_, > . <= redistribute it and/or modify it under 11.> <`_, > . <= redistribute it and/or modify it under
12:`=1 )Y*s>-.-- : the terms of the GNU Library General Public 12:`=1 )Y*s>-.-- : the terms of the GNU Library General Public
13.="- .-=="i, .._ License as published by the Free Software 13.="- .-=="i, .._ License as published by the Free Software
14 - . .-<_> .<> Foundation; either version 2 of the License, 14 - . .-<_> .<> Foundation; either version 2 of the License,
15 ._= =} : or (at your option) any later version. 15 ._= =} : or (at your option) any later version.
16 .%`+i> _;_. 16 .%`+i> _;_.
17 .i_,=:_. -<s. This library is distributed in the hope that 17 .i_,=:_. -<s. This library is distributed in the hope that
18 + . -:. = it will be useful, but WITHOUT ANY WARRANTY; 18 + . -:. = it will be useful, but WITHOUT ANY WARRANTY;
19 : .. .:, . . . without even the implied warranty of 19 : .. .:, . . . without even the implied warranty of
20 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A 20 =_ + =;=|` MERCHANTABILITY or FITNESS FOR A
21 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU 21 _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU
22..}^=.= = ; Library General Public License for more 22..}^=.= = ; Library General Public License for more
23++= -. .` .: details. 23++= -. .` .: details.
24 : = ...= . :.=- 24 : = ...= . :.=-
25 -. .:....=;==+<; You should have received a copy of the GNU 25 -. .:....=;==+<; You should have received a copy of the GNU
26 -_. . . )=. = Library General Public License along with 26 -_. . . )=. = Library General Public License along with
27 -- :-=` this library; see the file COPYING.LIB. 27 -- :-=` this library; see the file COPYING.LIB.
28 If not, write to the Free Software Foundation, 28 If not, write to the Free Software Foundation,
29 Inc., 59 Temple Place - Suite 330, 29 Inc., 59 Temple Place - Suite 330,
30 Boston, MA 02111-1307, USA. 30 Boston, MA 02111-1307, USA.
@@ -37,15 +37,15 @@
37 37
38#include <opie2/multiauthconfigwidget.h> 38#include <opie2/multiauthconfigwidget.h>
39 39
40class PinConfigWidget : public MultiauthConfigWidget { 40class PinConfigWidget : public Opie::Security::MultiauthConfigWidget {
41public: 41public:
42 PinConfigWidget(QWidget* parent, const char* name); 42 PinConfigWidget(QWidget* parent, const char* name);
43 virtual ~PinConfigWidget(); 43 virtual ~PinConfigWidget();
44 virtual void writeConfig(); 44 virtual void writeConfig();
45///\todo to protect? 45///\todo to protect?
46 QPushButton *changePIN; 46 QPushButton *changePIN;
47 QPushButton *clearPIN; 47 QPushButton *clearPIN;
48 48
49}; 49};
50 50
51#endif // PINCONFIGWIDGET_H 51#endif // PINCONFIGWIDGET_H
diff --git a/noncore/securityplugins/pin/pinpluginimpl.cpp b/noncore/securityplugins/pin/pinpluginimpl.cpp
index 1c32f81..6cd2467 100644
--- a/noncore/securityplugins/pin/pinpluginimpl.cpp
+++ b/noncore/securityplugins/pin/pinpluginimpl.cpp
@@ -1,5 +1,8 @@
1#include "pinpluginimpl.h" 1#include "pinpluginimpl.h"
2 2
3using Opie::Security::MultiauthPluginObject;
4using Opie::Security::MultiauthPluginInterface;
5
3PinPluginImpl::PinPluginImpl() { 6PinPluginImpl::PinPluginImpl() {
4 pinPlugin = new PinPlugin(); 7 pinPlugin = new PinPlugin();
5} 8}
diff --git a/noncore/securityplugins/pin/pinpluginimpl.h b/noncore/securityplugins/pin/pinpluginimpl.h
index e604b64..cbb9ef0 100644
--- a/noncore/securityplugins/pin/pinpluginimpl.h
+++ b/noncore/securityplugins/pin/pinpluginimpl.h
@@ -37,7 +37,7 @@
37#include "pin.h" 37#include "pin.h"
38 38
39/// Standard multiauth plugin class 39/// Standard multiauth plugin class
40class PinPluginImpl : public MultiauthPluginInterface{ 40class PinPluginImpl : public Opie::Security::MultiauthPluginInterface{
41 41
42 public: 42 public:
43 PinPluginImpl(); 43 PinPluginImpl();
@@ -47,12 +47,11 @@ class PinPluginImpl : public MultiauthPluginInterface{
47 // defines standard addRef() and release() functions 47 // defines standard addRef() and release() functions
48 Q_REFCOUNT; 48 Q_REFCOUNT;
49 49
50 virtual MultiauthPluginObject *plugin(); 50 virtual Opie::Security::MultiauthPluginObject *plugin();
51 51
52 private: 52 private:
53 /// the plugin itself 53 /// the plugin itself
54 PinPlugin *pinPlugin; 54 PinPlugin *pinPlugin;
55 ulong ref;
56}; 55};
57 56
58#endif 57#endif