-rw-r--r-- | core/settings/security/security.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/core/settings/security/security.cpp b/core/settings/security/security.cpp index c4726b3..00ea105 100644 --- a/core/settings/security/security.cpp +++ b/core/settings/security/security.cpp @@ -106,33 +106,37 @@ void Security::updateGUI() autologinToggle->setChecked(autoLogin); userlist->setEnabled(autoLogin); } void Security::show() { - valid=FALSE; + //valid=FALSE; setEnabled(FALSE); SecurityBase::show(); if ( passcode.isEmpty() ) { // could insist... //changePassCode(); //if ( passcode.isEmpty() ) //reject(); } else { + + if (!valid) // security passcode was not asked yet, so ask now + { QString pc = enterPassCode(tr("Enter passcode")); if ( pc != passcode ) { QMessageBox::critical(this, tr("Passcode incorrect"), tr("The passcode entered is incorrect.\nAccess denied")); reject(); return; } } + } setEnabled(TRUE); valid=TRUE; } void Security::accept() { applySecurity(); QDialog::accept(); @@ -208,33 +212,39 @@ void Security::loadUsers ( void ) if ( *account.at(0) == autoLoginName) userlist->setCurrentItem(userlist->count()-1); } } passwd.close(); } } + void Security::toggleAutoLogin(bool val) { autoLogin=val; userlist->setEnabled(val); if (!autoLogin) autoLoginName=userlist->currentText(); } + + + + void Security::setSyncNet(const QString& sn) { int auth_peer,auth_peer_bits; parseNet(sn,auth_peer,auth_peer_bits); selectNet(auth_peer,auth_peer_bits); } void Security::applySecurity() { if ( valid ) { +<<<<<<< security.cpp Config cfg("Security"); cfg.setGroup("Passcode"); cfg.writeEntry("passcode",passcode); cfg.writeEntry("passcode_poweron",passcode_poweron->isChecked()); cfg.setGroup("Sync"); int auth_peer=0; int auth_peer_bits; QString sn = syncnet->currentText(); @@ -257,16 +267,17 @@ void Security::applySecurity() if (autoLogin) { loginCfg.writeEntry("AutoLogin",autoLoginName); } else { loginCfg.removeEntry("AutoLogin"); } cfg.setGroup("SyncMode"); cfg.writeEntry("Mode", syncModeCombo->currentItem()+1 ); + } } void Security::changeLoginName( int idx ) { autoLoginName = userlist->text(idx);; updateGUI(); } |