static std::string getDisplayString(const std::string& first, const std::string& last, const std::string& grid, bool is_secondlife) { //grid comes via LLSavedLoginEntry, which uses full grid names, not nicks if(grid == gHippoGridManager->getDefaultGridName()) return nameJoin(first, last, is_secondlife); else return nameJoin(first, last, is_secondlife) + " (" + grid + ")"; }
// static void LLPanelLogin::setFields(const LLSavedLoginEntry& entry, bool takeFocus) { if (!sInstance) { llwarns << "Attempted setFields with no login view shown" << llendl; return; } LLCheckBoxCtrl* remember_pass_check = sInstance->getChild<LLCheckBoxCtrl>("remember_check"); std::string fullname = nameJoin(entry.getFirstName(), entry.getLastName(), entry.isSecondLife()); LLComboBox* login_combo = sInstance->getChild<LLComboBox>("username_combo"); login_combo->setTextEntry(fullname); login_combo->resetTextDirty(); //sInstance->childSetText("username_combo", fullname); std::string grid = entry.getGrid(); //grid comes via LLSavedLoginEntry, which uses full grid names, not nicks if(!grid.empty() && gHippoGridManager->getGrid(grid) && grid != gHippoGridManager->getCurrentGridName()) { gHippoGridManager->setCurrentGrid(grid); } if (entry.getPassword().empty()) { sInstance->childSetText("password_edit", std::string("")); remember_pass_check->setValue(LLSD(false)); } else { const std::string filler("123456789!123456"); sInstance->childSetText("password_edit", filler); sInstance->mIncomingPassword = filler; sInstance->mMungedPassword = entry.getPassword(); remember_pass_check->setValue(LLSD(true)); } if (takeFocus) { giveFocus(); } }
// static void LLPanelLogin::setFields(const std::string& firstname, const std::string& lastname, const std::string& password, const LLSavedLogins& login_history) { if (!sInstance) { llwarns << "Attempted fillFields with no login view shown" << llendl; return; } LLComboBox* login_combo = sInstance->getChild<LLComboBox>("name_combo"); llassert_always(firstname.find(' ') == std::string::npos); login_combo->setLabel(nameJoin(firstname, lastname)); // Max "actual" password length is 16 characters. // Hex digests are always 32 characters. if (password.length() == 32) { // This is a MD5 hex digest of a password. // We don't actually use the password input field, // fill it with MAX_PASSWORD characters so we get a // nice row of asterixes. const std::string filler("123456789!123456"); sInstance->childSetText("password_edit", filler); sInstance->mIncomingPassword = filler; sInstance->mMungedPassword = password; } else { // this is a normal text password sInstance->childSetText("password_edit", password); sInstance->mIncomingPassword = password; LLMD5 pass((unsigned char *)password.c_str()); char munged_password[MD5HEX_STR_SIZE]; pass.hex_digest(munged_password); sInstance->mMungedPassword = munged_password; } }
static std::string getDisplayString(const std::string& first, const std::string& last, const std::string& grid) { if(grid == gHippoGridManager->getDefaultGridNick()) return nameJoin(first, last); else return nameJoin(first, last) + " (" + grid + ")"; }