-rw-r--r-- | noncore/securityplugins/pin/pin.cpp | 5 | ||||
-rw-r--r-- | noncore/securityplugins/pin/pin.h | 4 | ||||
-rw-r--r-- | noncore/securityplugins/pin/pinConfigWidget.cpp | 2 | ||||
-rw-r--r-- | noncore/securityplugins/pin/pinConfigWidget.h | 2 | ||||
-rw-r--r-- | noncore/securityplugins/pin/pinpluginimpl.cpp | 3 | ||||
-rw-r--r-- | noncore/securityplugins/pin/pinpluginimpl.h | 5 |
6 files changed, 14 insertions, 7 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 @@ -20,50 +20,53 @@ ** not clear to you. ** **********************************************************************/ #include "pin.h" #include "pinDialogBase.h" #include "pinConfigWidget.h" /* OPIE */ #include <opie2/odebug.h> #include <opie2/oapplication.h> /* QT */ #include <qpe/config.h> #include <qlabel.h> #include <qlineedit.h> #include <qtextview.h> #include <qstring.h> #include <qdialog.h> /* UNIX */ #include <unistd.h> #include <stdlib.h> #include <time.h> extern "C" char *crypt(const char *key, const char *salt); +using Opie::Security::MultiauthConfigWidget; +using Opie::Security::MultiauthPluginObject; + /// set to TRUE when we press the 'Skip' button -bool isSkip = FALSE; +static bool isSkip = FALSE; /// PIN input graphical widget. /** * Inherits the PinDialogBase class defined originally in pinDialogBase.ui interface file. * \sa PinDlg and PinDialog (the class generated from the .ui file) * It comes from the original PIN locking code in Opie : * \sa http://dudu.dyn.2-h.org/opiedoxydoc/library_2password_8cpp-source.html */ class PinDialog : public PinDialogBase { Q_OBJECT public: PinDialog( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); ~PinDialog(); void clear(); void setPrompt( const QString& ); signals: /// emitted when we press the Enter button void passwordEntered( const QString& ); /// emitted when we press the Skip button void skip(); 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 @@ -22,47 +22,47 @@ ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PIN_H #define PIN_H #include <qobject.h> #include <qstring.h> #include <opie2/multiauthplugininterface.h> #include "pinConfigWidget.h" /// Multi-authentication plugin, implementing a PIN verification. /** * The plugin itself, implementing the main authenticate() function. */ -class PinPlugin : public QObject, public MultiauthPluginObject { +class PinPlugin : public QObject, public Opie::Security::MultiauthPluginObject { Q_OBJECT public: int authenticate(); - MultiauthConfigWidget * configWidget(QWidget * parent); + Opie::Security::MultiauthConfigWidget * configWidget(QWidget * parent); QString pixmapNameConfig() const; QString pixmapNameWidget() const; QString pluginName() const; private slots: QString getPIN( const QString& prompt ); QString getCryptedPIN( const QString& prompt ); void changePIN(); void clearPIN(); private: QString encrypt(const QString& pin); bool verify(const QString& pin, const QString& hash); }; #endif // PIN_H 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 @@ -1,31 +1,33 @@ #include <qwidget.h> #include <qlayout.h> #include <qlabel.h> #include <qgroupbox.h> #include "pinConfigWidget.h" +using Opie::Security::MultiauthConfigWidget; + PinConfigWidget::PinConfigWidget(QWidget* parent = 0, const char* name = "PIN configuration widget") : MultiauthConfigWidget(parent, name) { QVBoxLayout * baseLayout = new QVBoxLayout( this); baseLayout->setSpacing(11); baseLayout->setMargin(11); baseLayout->setAlignment( Qt::AlignTop ); QGroupBox * configBox = new QGroupBox(0, Qt::Vertical, tr("Configure your PIN here"), this); baseLayout->addWidget(configBox); QVBoxLayout *boxLayout = new QVBoxLayout( configBox->layout() ); QLabel * description = new QLabel("<p>" + tr("PIN protection provides a minimal level of protection from casual access to this device.") + "</p>", configBox); boxLayout->addWidget(description); QHBoxLayout * buttonLayout = new QHBoxLayout(); buttonLayout->setSpacing(6); changePIN = new QPushButton( tr("Change PIN"), configBox, "changePIN" ); clearPIN = new QPushButton( tr("Clear PIN"), configBox, "clearPIN" ); buttonLayout->addWidget(changePIN); buttonLayout->addWidget(clearPIN); boxLayout->addLayout(buttonLayout); } 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 @@ -16,36 +16,36 @@ .%`+i> _;_. .i_,=:_. -<s. This library 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 ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PINCONFIGWIDGET_H #define PINCONFIGWIDGET_H #include <qpushbutton.h> #include <opie2/multiauthconfigwidget.h> -class PinConfigWidget : public MultiauthConfigWidget { +class PinConfigWidget : public Opie::Security::MultiauthConfigWidget { public: PinConfigWidget(QWidget* parent, const char* name); virtual ~PinConfigWidget(); virtual void writeConfig(); ///\todo to protect? QPushButton *changePIN; QPushButton *clearPIN; }; #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,26 +1,29 @@ #include "pinpluginimpl.h" +using Opie::Security::MultiauthPluginObject; +using Opie::Security::MultiauthPluginInterface; + PinPluginImpl::PinPluginImpl() { pinPlugin = new PinPlugin(); } PinPluginImpl::~PinPluginImpl() { delete pinPlugin; } MultiauthPluginObject* PinPluginImpl::plugin() { return pinPlugin; } Q_EXPORT_INTERFACE() { Q_CREATE_INSTANCE( PinPluginImpl ) } QRESULT PinPluginImpl::queryInterface( const QUuid & uuid, QUnknownInterface **iface ) { *iface = 0; if ( ( uuid == IID_QUnknown ) || ( uuid == IID_MultiauthPluginInterface ) ) { *iface = this, (*iface)->addRef(); } else { return QE_NOINTERFACE; } return QS_OK; 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 @@ -16,43 +16,42 @@ .%`+i> _;_. .i_,=:_. -<s. This library 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 ..}^=.= = ; Library General Public License for more ++= -. .` .: details. : = ...= . :.=- -. .:....=;==+<; You should have received a copy of the GNU -_. . . )=. = Library General Public License along with -- :-=` this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef PIN_PLUGIN_IMPL_H #define PIN_PLUGIN_IMPL_H #include "pin.h" /// Standard multiauth plugin class -class PinPluginImpl : public MultiauthPluginInterface{ +class PinPluginImpl : public Opie::Security::MultiauthPluginInterface{ public: PinPluginImpl(); virtual ~PinPluginImpl(); QRESULT queryInterface( const QUuid &, QUnknownInterface** ); // defines standard addRef() and release() functions Q_REFCOUNT; - virtual MultiauthPluginObject *plugin(); + virtual Opie::Security::MultiauthPluginObject *plugin(); private: /// the plugin itself PinPlugin *pinPlugin; - ulong ref; }; #endif |