Diffstat (limited to 'core/settings/security/multiauthconfig.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/settings/security/multiauthconfig.cpp | 50 |
1 files changed, 46 insertions, 4 deletions
diff --git a/core/settings/security/multiauthconfig.cpp b/core/settings/security/multiauthconfig.cpp index 93e73c3..535352a 100644 --- a/core/settings/security/multiauthconfig.cpp +++ b/core/settings/security/multiauthconfig.cpp @@ -113,16 +113,42 @@ void MultiauthGeneralConfig::checkBypass() if ( (allowBypass->isChecked() == true) && (explanScreens->isChecked() == false) ) allowBypass->setChecked(false); } + + + + + + + + + + /// Builds and displays the Opie multi-authentication configuration dialog -MultiauthConfig::MultiauthConfig() : QDialog(0, 0, TRUE), - m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), - m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), - m_nbSuccessReq(0), m_plugins_changed(false) +static void test_and_start() { + Config pcfg("Security"); + pcfg.setGroup( "Misc" ); + bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true); + + if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) { + owarn << "authentication failed, not showing opie-security" << oendl; + exit( -1 ); + } +} + + + +MultiauthConfig::MultiauthConfig(QWidget* par, const char* w, WFlags f) + : QDialog(par, w, TRUE, f), + m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), + m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), + m_nbSuccessReq(0), m_plugins_changed(false) { /* Initializes the global configuration window */ + test_and_start(); + setCaption( tr( "Security configuration" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); m_mainTW = new Opie::Ui::OTabWidget( this ); layout->addWidget(m_mainTW); @@ -205,8 +231,24 @@ MultiauthConfig::MultiauthConfig() : QDialog(0, 0, TRUE), MultiauthConfig::~MultiauthConfig() { } +void MultiauthConfig::accept() { + writeConfig(); + + MultiauthConfigWidget* confWidget = 0; + for ( confWidget = configWidgetList.first(); confWidget != 0; + confWidget = configWidgetList.next() ) + confWidget->writeConfig(); + + QDialog::accept(); +} + +void MultiauthConfig::done( int r ) { + QDialog::done( r ); + close(); +} + /// moves up the selected plugin void MultiauthConfig::moveSelectedUp() { QListViewItem *item = m_pluginListView->selectedItem(); |