Diffstat (limited to 'core/settings/security/main.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/security/main.cpp | 43 |
1 files changed, 2 insertions, 41 deletions
diff --git a/core/settings/security/main.cpp b/core/settings/security/main.cpp index 7f24490..5ba9869 100644 --- a/core/settings/security/main.cpp +++ b/core/settings/security/main.cpp | |||
@@ -1,44 +1,5 @@ | |||
1 | #include "multiauthconfig.h" | 1 | #include "multiauthconfig.h" |
2 | #include <opie2/oapplication.h> | ||
3 | #include <opie2/odebug.h> | ||
4 | 2 | ||
3 | #include <opie2/oapplicationfactory.h> | ||
5 | 4 | ||
6 | 5 | OPIE_EXPORT_APP( Opie::Core::OApplicationFactory<MultiauthConfig> ); | |
7 | int main(int argc, char **argv) { | ||
8 | Opie::Core::OApplication app(argc, argv, "MultiAuthentication Config"); | ||
9 | // protect this dialog if option set | ||
10 | Config* pcfg = new Config("Security"); | ||
11 | pcfg->setGroup( "Misc" ); | ||
12 | bool protectConfigDialog = ! pcfg->readBoolEntry("noProtectConfig", true); | ||
13 | delete pcfg; | ||
14 | bool show = true; | ||
15 | if ( protectConfigDialog ) | ||
16 | { | ||
17 | if (Opie::Security::Internal::runPlugins() != 0) | ||
18 | { | ||
19 | // authentication failed | ||
20 | show = false; | ||
21 | } | ||
22 | } | ||
23 | if ( show == true ){ | ||
24 | MultiauthConfig dialog; | ||
25 | app.setMainWidget(&dialog); | ||
26 | |||
27 | if ( dialog.exec() == QDialog::Accepted ) { | ||
28 | // write the general, login and sync config | ||
29 | dialog.writeConfig(); | ||
30 | // call writeConfig() on each plugin config widget | ||
31 | Opie::Security::MultiauthConfigWidget *confWidget; | ||
32 | for ( confWidget = dialog.configWidgetList.first(); confWidget != 0; | ||
33 | confWidget = dialog.configWidgetList.next() ) { | ||
34 | confWidget->writeConfig(); | ||
35 | } | ||
36 | } | ||
37 | dialog.close(); | ||
38 | app.quit(); | ||
39 | return 0; | ||
40 | } else { | ||
41 | owarn << "authentication failed, not showing opie-security" << oendl; | ||
42 | return 1; | ||
43 | } | ||
44 | } | ||