summaryrefslogtreecommitdiff
authorclem <clem>2004-10-07 00:12:55 (UTC)
committer clem <clem>2004-10-07 00:12:55 (UTC)
commit08bb0269afae5ad4a23fc5677cdda6554342da5c (patch) (unidiff)
tree21ddd5f576967ef390c555f6fa26a78a28a6e6c3
parentd2256c288998704c0b43986865c884070b983d89 (diff)
downloadopie-08bb0269afae5ad4a23fc5677cdda6554342da5c.zip
opie-08bb0269afae5ad4a23fc5677cdda6554342da5c.tar.gz
opie-08bb0269afae5ad4a23fc5677cdda6554342da5c.tar.bz2
improved class comment
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiesecurity/multiauthpassword.cpp11
-rw-r--r--libopie2/opiesecurity/multiauthpassword.h4
2 files changed, 7 insertions, 8 deletions
diff --git a/libopie2/opiesecurity/multiauthpassword.cpp b/libopie2/opiesecurity/multiauthpassword.cpp
index b793717..42341f7 100644
--- a/libopie2/opiesecurity/multiauthpassword.cpp
+++ b/libopie2/opiesecurity/multiauthpassword.cpp
@@ -45,62 +45,61 @@
45#include <qpushbutton.h> 45#include <qpushbutton.h>
46#include <qlabel.h> 46#include <qlabel.h>
47#include <qdir.h> 47#include <qdir.h>
48 48
49#include "multiauthpassword.h" 49#include "multiauthpassword.h"
50 50
51namespace Opie { 51namespace Opie {
52namespace Security { 52namespace Security {
53 53
54 54
55/** 55/**
56 * If the users requires authentication... #fixme 56 * If the users requires authentication... #fixme
57 * 57 *
58 * @todo fix up at_poweron attribute 58 * @todo fix up at_poweron attribute
59 */ 59 */
60bool MultiauthPassword::needToAuthenticate(bool at_poweron) 60bool MultiauthPassword::needToAuthenticate(bool at_poweron)
61{ 61{
62 Config cfg("Security"); 62 Config cfg("Security");
63 cfg.setGroup("Misc"); 63 cfg.setGroup("Misc");
64 if ( !at_poweron && cfg.readBoolEntry("onStart", false) ) 64 if ( !at_poweron && cfg.readBoolEntry("onStart", false) )
65 return true; 65 return true;
66 else if ( at_poweron && cfg.readBoolEntry("onResume", false) ) 66 else if ( at_poweron && cfg.readBoolEntry("onResume", false) )
67 return true; 67 return true;
68 else 68 else
69 return false; 69 return false;
70} 70}
71 71
72 72
73/** 73/**
74 * \brief Require user authentication to unlock and continue 74 * \brief Require user authentication to unlock and continue
75 * 75 *
76 * This method will check if you require authentication 76 * This method will check if you require authentication
77 * and then will lock the screen and require a succesfull 77 * and then will lock the screen and ask for a successful
78 * authentication. 78 * authentication (explaining what it does or not, depending
79 * Authenticate may enter the event loop and only returns 79 * on your local configuration).
80 * if the user sucesfully authenticated to the system. 80 * It may go into an event loop, but anyhow it will only end
81 * 81 * when the user has successfully authenticated to the system.
82 * @return only if succesfully authenticated
83 */ 82 */
84void MultiauthPassword::authenticate(bool at_poweron) 83void MultiauthPassword::authenticate(bool at_poweron)
85{ 84{
86 if ( ! needToAuthenticate(at_poweron) ) 85 if ( ! needToAuthenticate(at_poweron) )
87 return; 86 return;
88 87
89 /* Constructs the main window, which displays messages and blocks 88 /* Constructs the main window, which displays messages and blocks
90 * access to the desktop 89 * access to the desktop
91 */ 90 */
92 MultiauthMainWindow win; 91 MultiauthMainWindow win;
93 92
94 // resize the QDialog object so it fills all the screen 93 // resize the QDialog object so it fills all the screen
95 QRect desk = qApp->desktop()->geometry(); 94 QRect desk = qApp->desktop()->geometry();
96 win.setGeometry( 0, 0, desk.width(), desk.height() ); 95 win.setGeometry( 0, 0, desk.width(), desk.height() );
97 96
98 // the authentication has already succeeded (without win interactions) 97 // the authentication has already succeeded (without win interactions)
99 if ( win.isAlreadyDone() ) 98 if ( win.isAlreadyDone() )
100 return; 99 return;
101 100
102 win.exec(); 101 win.exec();
103} 102}
104 103
105} 104}
106} 105}
diff --git a/libopie2/opiesecurity/multiauthpassword.h b/libopie2/opiesecurity/multiauthpassword.h
index f43934d..fe276da 100644
--- a/libopie2/opiesecurity/multiauthpassword.h
+++ b/libopie2/opiesecurity/multiauthpassword.h
@@ -10,50 +10,50 @@
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.
31 31
32*/ 32*/
33 33
34 34
35#ifndef OPIE_SEC_MULTIAUTHPASSWORD_H 35#ifndef OPIE_SEC_MULTIAUTHPASSWORD_H
36#define OPIE_SEC_MULTIAUTHPASSWORD_H 36#define OPIE_SEC_MULTIAUTHPASSWORD_H
37 37
38namespace Opie { 38namespace Opie {
39namespace Security { 39namespace Security {
40 40
41/** 41/**
42 * This is the dropin replacement for libqpes Password class. 42 * This is the dropin replacement for the libqpe Password class.
43 * If you call authenticate() a widget will cover the whole screen 43 * If you call authenticate() a widget will cover the whole screen
44 * and only return if the user is able to authenticate with any of the 44 * and only return if the user is able to authenticate with any of the
45 * configured Authentication Plugins. 45 * configured Authentication Plugins.
46 * This uses the \sa Opie::Security::MultiauthMainWindow internally. 46 * It uses the Opie::Security::MultiauthMainWindow QDialog internally.
47 * 47 *
48 * @author Clement Séveillac, Holger Freyther 48 * @author Clement Séveillac, Holger Freyther
49 */ 49 */
50class MultiauthPassword { 50class MultiauthPassword {
51public: 51public:
52 static bool needToAuthenticate( bool atpoweron = false ); 52 static bool needToAuthenticate( bool atpoweron = false );
53 static void authenticate(bool atpoweron = false); 53 static void authenticate(bool atpoweron = false);
54}; 54};
55 55
56 56
57} 57}
58} 58}
59#endif 59#endif