author | clem <clem> | 2004-10-05 23:38:06 (UTC) |
---|---|---|
committer | clem <clem> | 2004-10-05 23:38:06 (UTC) |
commit | c09e45b02053c61b4e195c9d79a573ebfed2c521 (patch) (unidiff) | |
tree | 504a1a7d6b29e9dc186b2a7a7431ea41482041e3 /libopie2 | |
parent | 2d05ffb4bad93532e17b9350ff2d66fe3419cbe3 (diff) | |
download | opie-c09e45b02053c61b4e195c9d79a573ebfed2c521.zip opie-c09e45b02053c61b4e195c9d79a573ebfed2c521.tar.gz opie-c09e45b02053c61b4e195c9d79a573ebfed2c521.tar.bz2 |
Changed the way to test authentication: instead of having a hardcoded config
option, allowByPass, we now have a "Test now" button in the configuration
interface. We add to change both the config app and the libopie2security files
for that, since the MultiauthMainWindow constructor has to know whether to
implement a debug mode (with an new argument, false by default). We also had
to give MultiauthGeneralConfig a link to MultiauthConfig, since the test
button triggers the writing of the whole configuration.
Some cleaning too (m_ on *all* member attributes, removal of obsolete
allowByPass / explanScreens checking code.
-rw-r--r-- | libopie2/opiesecurity/multiauthmainwindow.cpp | 29 | ||||
-rw-r--r-- | libopie2/opiesecurity/multiauthmainwindow.h | 2 |
2 files changed, 20 insertions, 11 deletions
diff --git a/libopie2/opiesecurity/multiauthmainwindow.cpp b/libopie2/opiesecurity/multiauthmainwindow.cpp index fa247ab..fb720bb 100644 --- a/libopie2/opiesecurity/multiauthmainwindow.cpp +++ b/libopie2/opiesecurity/multiauthmainwindow.cpp | |||
@@ -8,4 +8,7 @@ namespace Security { | |||
8 | 8 | ||
9 | /// Initializes widgets according to allowBypass and explanScreens config | 9 | /// Initializes widgets according to allowBypass argument (false by default) and explanScreens config |
10 | MultiauthMainWindow::MultiauthMainWindow() | 10 | /** |
11 | * \note if allowBypass is true, we will show explanatory screens anyway | ||
12 | */ | ||
13 | MultiauthMainWindow::MultiauthMainWindow(bool allowBypass = false) | ||
11 | : QDialog(0, "main Opie multiauth modal dialog", TRUE, | 14 | : QDialog(0, "main Opie multiauth modal dialog", TRUE, |
@@ -19,7 +22,11 @@ MultiauthMainWindow::MultiauthMainWindow() | |||
19 | 22 | ||
20 | Config *pcfg = new Config("Security"); | 23 | if (allowBypass == true) |
21 | pcfg->setGroup("Misc"); | 24 | explanScreens = true; |
22 | explanScreens = pcfg->readBoolEntry("explanScreens", true); | 25 | else |
23 | allowBypass = pcfg->readBoolEntry("allowBypass", false); | 26 | { |
24 | delete pcfg; | 27 | Config *pcfg = new Config("Security"); |
28 | pcfg->setGroup("Misc"); | ||
29 | explanScreens = pcfg->readBoolEntry("explanScreens", true); | ||
30 | delete pcfg; | ||
31 | } | ||
25 | 32 | ||
@@ -55,3 +62,3 @@ MultiauthMainWindow::MultiauthMainWindow() | |||
55 | // very important: we can close the widget through the quit button, and bypass authentication, only if allowBypass is set! | 62 | // very important: we can close the widget through the quit button, and bypass authentication, only if allowBypass is set! |
56 | message2 = new QLabel("<center><i>" + tr("Note: the 'exit' button should be removed for real protection, through Security config dialog") + ".</i></center>", this); | 63 | message2 = new QLabel("<center><i>" + tr("Note: this 'exit' button only appears during <b>simulations</b>, like the one we are in.") + "</i></center>", this); |
57 | layout->addWidget(message2); | 64 | layout->addWidget(message2); |
@@ -116,6 +123,8 @@ void MultiauthMainWindow::proceed() { | |||
116 | // authentication has failed, explain that according to allowBypass | 123 | // authentication has failed, explain that according to allowBypass |
117 | message->setText( "<center><h3>" + tr("You have not succeeded enough authentication steps!") + "</h3></center>" ); | 124 | message->setText( "<center><h3>" + tr("You have <b>not</b> succeeded enough authentication steps!") + "</h3></center>" ); |
118 | proceedButton->show(); | 125 | proceedButton->show(); |
119 | if ( allowBypass == true ) | 126 | if ( allowBypass == true ) |
120 | message2->setText( "<center><p>" + tr("Note: if 'allow to bypass' was uncheck in Security config, you would have to go back through all the steps now.") + "</p></center>" ); | 127 | { |
128 | message2->setText( "<center><p>" + tr("Be careful: if this was not a <b>simulation</b>, you would have to go back through all the steps now.") + "</p></center>" ); | ||
129 | message2->show(); | ||
121 | } | 130 | } |
diff --git a/libopie2/opiesecurity/multiauthmainwindow.h b/libopie2/opiesecurity/multiauthmainwindow.h index 626b8b3..9d2376b 100644 --- a/libopie2/opiesecurity/multiauthmainwindow.h +++ b/libopie2/opiesecurity/multiauthmainwindow.h | |||
@@ -57,3 +57,3 @@ class MultiauthMainWindow : public QDialog { | |||
57 | public: | 57 | public: |
58 | MultiauthMainWindow(); | 58 | MultiauthMainWindow(bool allowBypass = false); |
59 | ~MultiauthMainWindow(); | 59 | ~MultiauthMainWindow(); |