void PasswordControl::updateControlsState() { if (m_changeButton != 0) { if (hasPassword()) { m_changeButton->setText(StringTable::getString(IDS_CHANGE_PASSWORD_CAPTION)); } else { m_changeButton->setText(StringTable::getString(IDS_SET_PASSWORD_CAPTION)); } m_changeButton->setEnabled(m_enabled); } if (m_unsetButton != 0) { m_unsetButton->setEnabled(m_enabled && hasPassword()); } }
bool Maps::OpenMap(std::string fileName) { auto newMap = AddEmptyMap(); if ( newMap->LoadMapFile(fileName) ) { if ( newMap->CreateThis(getHandle(), fileName) ) { SetWindowText(newMap->getHandle(), fileName.c_str()); EnableMapping(); Focus(newMap); if ( newMap->isProtected() && newMap->hasPassword() ) chkd.enterPasswordWindow.CreateThis(chkd.getHandle()); else if ( newMap->isProtected() ) mb("Map is protected and will be opened as view only"); SetFocus(chkd.getHandle()); currentlyActiveMap->Scroll(true, true, false); currentlyActiveMap->Redraw(true); currentlyActiveMap->refreshScenario(); return true; } else Error("Failed to create MDI Child Window!"); } RemoveMap(newMap); return false; }
bool PasswordControl::showChangePasswordModalDialog(Control *parent) { ChangePasswordDialog changePasswordDialog(parent, !hasPassword()); if (changePasswordDialog.showModal() != IDOK) { return false; } setPassword(changePasswordDialog.getPasswordInPlainText()); return true; }
void CachedPasswordProvider::addPasswordForIp(const IpAddress & ip) { if (!hasPassword(ip)) { IPasswordProvider * provider = queryPasswordProvider(); StringBuffer username, password; if (provider && provider->getPassword(ip, username, password)) { CachedPassword & cur = * new CachedPassword; cur.ip.ipset(ip); cur.password.set(password.str()); cur.username.set(username.str()); passwords.append(cur); } } }