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 | |||
@@ -111,20 +111,46 @@ void MultiauthGeneralConfig::checkScreens() | |||
111 | void MultiauthGeneralConfig::checkBypass() | 111 | void MultiauthGeneralConfig::checkBypass() |
112 | { | 112 | { |
113 | if ( (allowBypass->isChecked() == true) && (explanScreens->isChecked() == false) ) | 113 | if ( (allowBypass->isChecked() == true) && (explanScreens->isChecked() == false) ) |
114 | allowBypass->setChecked(false); | 114 | allowBypass->setChecked(false); |
115 | } | 115 | } |
116 | 116 | ||
117 | |||
118 | |||
119 | |||
120 | |||
121 | |||
122 | |||
123 | |||
124 | |||
125 | |||
126 | |||
117 | /// Builds and displays the Opie multi-authentication configuration dialog | 127 | /// Builds and displays the Opie multi-authentication configuration dialog |
118 | MultiauthConfig::MultiauthConfig() : QDialog(0, 0, TRUE), | 128 | static void test_and_start() { |
129 | Config pcfg("Security"); | ||
130 | pcfg.setGroup( "Misc" ); | ||
131 | bool protectConfigDialog = ! pcfg.readBoolEntry("noProtectConfig", true); | ||
132 | |||
133 | if (protectConfigDialog && Opie::Security::Internal::runPlugins() != 0) { | ||
134 | owarn << "authentication failed, not showing opie-security" << oendl; | ||
135 | exit( -1 ); | ||
136 | } | ||
137 | } | ||
138 | |||
139 | |||
140 | |||
141 | MultiauthConfig::MultiauthConfig(QWidget* par, const char* w, WFlags f) | ||
142 | : QDialog(par, w, TRUE, f), | ||
119 | m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), | 143 | m_mainTW(0), m_pluginListView(0), m_pluginListWidget(0), |
120 | m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), | 144 | m_generalConfig(0), m_loginWidget(0), m_syncWidget(0), |
121 | m_nbSuccessReq(0), m_plugins_changed(false) | 145 | m_nbSuccessReq(0), m_plugins_changed(false) |
122 | { | 146 | { |
123 | /* Initializes the global configuration window | 147 | /* Initializes the global configuration window |
124 | */ | 148 | */ |
149 | test_and_start(); | ||
150 | |||
125 | setCaption( tr( "Security configuration" ) ); | 151 | setCaption( tr( "Security configuration" ) ); |
126 | QVBoxLayout *layout = new QVBoxLayout( this ); | 152 | QVBoxLayout *layout = new QVBoxLayout( this ); |
127 | m_mainTW = new Opie::Ui::OTabWidget( this ); | 153 | m_mainTW = new Opie::Ui::OTabWidget( this ); |
128 | layout->addWidget(m_mainTW); | 154 | layout->addWidget(m_mainTW); |
129 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); | 155 | m_pluginListWidget = new QWidget(m_mainTW, "plugin list widget"); |
130 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); | 156 | QVBoxLayout * pluginListLayout = new QVBoxLayout(m_pluginListWidget); |
@@ -203,12 +229,28 @@ MultiauthConfig::MultiauthConfig() : QDialog(0, 0, TRUE), | |||
203 | 229 | ||
204 | /// nothing to do | 230 | /// nothing to do |
205 | MultiauthConfig::~MultiauthConfig() | 231 | MultiauthConfig::~MultiauthConfig() |
206 | { | 232 | { |
207 | } | 233 | } |
208 | 234 | ||
235 | void MultiauthConfig::accept() { | ||
236 | writeConfig(); | ||
237 | |||
238 | MultiauthConfigWidget* confWidget = 0; | ||
239 | for ( confWidget = configWidgetList.first(); confWidget != 0; | ||
240 | confWidget = configWidgetList.next() ) | ||
241 | confWidget->writeConfig(); | ||
242 | |||
243 | QDialog::accept(); | ||
244 | } | ||
245 | |||
246 | void MultiauthConfig::done( int r ) { | ||
247 | QDialog::done( r ); | ||
248 | close(); | ||
249 | } | ||
250 | |||
209 | /// moves up the selected plugin | 251 | /// moves up the selected plugin |
210 | void MultiauthConfig::moveSelectedUp() | 252 | void MultiauthConfig::moveSelectedUp() |
211 | { | 253 | { |
212 | QListViewItem *item = m_pluginListView->selectedItem(); | 254 | QListViewItem *item = m_pluginListView->selectedItem(); |
213 | if ( item && item->itemAbove() ) { | 255 | if ( item && item->itemAbove() ) { |
214 | item->itemAbove()->moveItem( item ); | 256 | item->itemAbove()->moveItem( item ); |