Changeset View
Changeset View
Standalone View
Standalone View
kded/secretagent.cpp
Show All 19 Lines | 1 | /* | |||
---|---|---|---|---|---|
20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | 20 | License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
21 | */ | 21 | */ | ||
22 | 22 | | |||
23 | #include "passworddialog.h" | 23 | #include "passworddialog.h" | ||
24 | #include "secretagent.h" | 24 | #include "secretagent.h" | ||
25 | 25 | | |||
26 | #include "debug.h" | 26 | #include "debug.h" | ||
27 | 27 | | |||
28 | #include "configuration.h" | ||||
29 | | ||||
28 | #include <NetworkManagerQt/Settings> | 30 | #include <NetworkManagerQt/Settings> | ||
29 | #include <NetworkManagerQt/ConnectionSettings> | 31 | #include <NetworkManagerQt/ConnectionSettings> | ||
30 | #include <NetworkManagerQt/GenericTypes> | 32 | #include <NetworkManagerQt/GenericTypes> | ||
31 | #include <NetworkManagerQt/GsmSetting> | 33 | #include <NetworkManagerQt/GsmSetting> | ||
32 | #include <NetworkManagerQt/Security8021xSetting> | 34 | #include <NetworkManagerQt/Security8021xSetting> | ||
33 | #include <NetworkManagerQt/VpnSetting> | 35 | #include <NetworkManagerQt/VpnSetting> | ||
34 | #include <NetworkManagerQt/WirelessSecuritySetting> | 36 | #include <NetworkManagerQt/WirelessSecuritySetting> | ||
35 | #include <NetworkManagerQt/WirelessSetting> | 37 | #include <NetworkManagerQt/WirelessSetting> | ||
▲ Show 20 Lines • Show All 363 Lines • ▼ Show 20 Line(s) | 399 | if (!secretsMap.isEmpty()) { | |||
399 | if (!isVpn && setting->needSecrets(requestNew).isEmpty()) { | 401 | if (!isVpn && setting->needSecrets(requestNew).isEmpty()) { | ||
400 | // Enough secrets were retrieved from storage | 402 | // Enough secrets were retrieved from storage | ||
401 | request.connection[request.setting_name] = setting->secretsToMap(); | 403 | request.connection[request.setting_name] = setting->secretsToMap(); | ||
402 | sendSecrets(request.connection, request.message); | 404 | sendSecrets(request.connection, request.message); | ||
403 | return true; | 405 | return true; | ||
404 | } | 406 | } | ||
405 | } | 407 | } | ||
406 | 408 | | |||
407 | if (requestNew || (allowInteraction && !setting->needSecrets(requestNew).isEmpty()) || (allowInteraction && userRequested) || (isVpn && allowInteraction)) { | 409 | if (!Configuration::showPasswordDialog()) { | ||
410 | sendError(SecretAgent::NoSecrets, "Cannot authenticate", request.message); | ||||
411 | return true; | ||||
412 | } else if (requestNew || (allowInteraction && !setting->needSecrets(requestNew).isEmpty()) || (allowInteraction && userRequested) || (isVpn && allowInteraction)) { | ||||
408 | m_dialog = new PasswordDialog(connectionSettings, request.flags, request.setting_name); | 413 | m_dialog = new PasswordDialog(connectionSettings, request.flags, request.setting_name); | ||
409 | connect(m_dialog, &PasswordDialog::accepted, this, &SecretAgent::dialogAccepted); | 414 | connect(m_dialog, &PasswordDialog::accepted, this, &SecretAgent::dialogAccepted); | ||
410 | connect(m_dialog, &PasswordDialog::rejected, this, &SecretAgent::dialogRejected); | 415 | connect(m_dialog, &PasswordDialog::rejected, this, &SecretAgent::dialogRejected); | ||
411 | 416 | | |||
412 | if (m_dialog->hasError()) { | 417 | if (m_dialog->hasError()) { | ||
413 | sendError(m_dialog->error(), | 418 | sendError(m_dialog->error(), | ||
414 | m_dialog->errorMessage(), | 419 | m_dialog->errorMessage(), | ||
415 | request.message); | 420 | request.message); | ||
▲ Show 20 Lines • Show All 230 Lines • Show Last 20 Lines |