Diffstat (limited to 'core/settings/security/multiauthconfig.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/settings/security/multiauthconfig.cpp | 44 |
1 files changed, 43 insertions, 1 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 @@ -105,32 +105,58 @@ void MultiauthGeneralConfig::checkScreens() { if ( (allowBypass->isChecked() == true) && (explanScreens->isChecked() == false) ) explanScreens->setChecked(true); } /// Be sure that allowBypass is not checked if explanScreens is not 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), +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); m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); pluginListLayout->setSpacing(6); pluginListLayout->setMargin(11); QLabel * pluginListTitle = new QLabel( tr( "Load which plugins in what order:" ), m_pluginListWidget ); pluginListLayout->addWidget(pluginListTitle); QHBox * pluginListHB = new QHBox(m_pluginListWidget); pluginListLayout->addWidget(pluginListHB); @@ -197,24 +223,40 @@ MultiauthConfig::MultiauthConfig() : QDialog(0, 0, TRUE), // put the number of plugins as the max number of req. auth. m_generalConfig->nbSuccessMin->setMaxValue( pluginList.count() ); showMaximized(); } /// nothing to do 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(); if ( item && item->itemAbove() ) { item->itemAbove()->moveItem( item ); } } /// moves down the selected plugin void MultiauthConfig::moveSelectedDown() { |