summaryrefslogtreecommitdiff
path: root/libopie2/opiesecurity/multiauthpassword.cpp
Unidiff
Diffstat (limited to 'libopie2/opiesecurity/multiauthpassword.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiesecurity/multiauthpassword.cpp11
1 files changed, 5 insertions, 6 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
@@ -53,54 +53,53 @@ namespace 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}