From b3c39a47e76f595fd953d9ccffc58b0dfb8359db Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Thu, 10 Sep 2009 02:38:36 -0500 Subject: Updated Grid Manager from Meerkat's SVN (as of r215). --- linden/indra/newview/authentication_model.cpp | 111 -------------------------- 1 file changed, 111 deletions(-) delete mode 100644 linden/indra/newview/authentication_model.cpp (limited to 'linden/indra/newview/authentication_model.cpp') diff --git a/linden/indra/newview/authentication_model.cpp b/linden/indra/newview/authentication_model.cpp deleted file mode 100644 index 763ab4a..0000000 --- a/linden/indra/newview/authentication_model.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * authentication_model.cpp - * SecondLife - * - * Created by RMS on 7/17/08. - * - */ - -#include "llviewerprecompiledheaders.h" - -#include "lldir.h" -#include "llfile.h" -#include "llsdserialize.h" -#include "authentication_model.h" - -AuthenticationModel::AuthenticationModel() -{ - loadPersistentData(); -} - -AuthenticationModel::~AuthenticationModel() -{ - savePersistentData(); -} - -void AuthenticationModel::loadPersistentData() -{ - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, - "cross_grid_authentication.xml"); - LLSD auth_llsd; - llifstream file; - file.open(filename); - if(file.is_open()) - LLSDSerialize::fromXML(mAuthLLSD, file); -} - -void AuthenticationModel::savePersistentData() -{ - std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, - "cross_grid_authentication.xml"); - llofstream ofile; - ofile.open(filename); - LLSDSerialize::toPrettyXML(mAuthLLSD, ofile); -} - -void AuthenticationModel::revert() -{ - loadPersistentData(); -} - -AuthenticationModel::connection_t AuthenticationModel::subscribeToModelUpdates - (event_t::slot_function_type subscriber) -{ - return mEventUpdate.connect(subscriber); -} - -void AuthenticationModel::unsubscribe(connection_t subscriber) -{ - subscriber.disconnect(); -} - -/* setters */ -void AuthenticationModel::addAccount(const std::string &grid, const std::string &accountName, - const std::string &accountPassword) -{ - mAuthLLSD[grid][accountName] = LLSD::LLSD(accountPassword); - mEventUpdate(); -} - -void AuthenticationModel::removeAccount(const std::string &grid, const std::string &accountName) -{ - mAuthLLSD[grid].erase(accountName); - mEventUpdate(); -} - -void AuthenticationModel::changePassword(const std::string &grid, const std::string &accountName, - const std::string &newPassword) -{ - mAuthLLSD[grid][accountName] = newPassword; - // no event necessary: passwords aren't displayed in any view -} - -/* getters */ - -void AuthenticationModel::getAllAccountNames(std::list &names) -{ - // TODO: implement this for account management -} - -void AuthenticationModel::getAccountNames(const std::string &grid, std::set &names) -{ - if(!mAuthLLSD.has(grid)) - return; - - for(LLSD::map_const_iterator it = mAuthLLSD[grid].beginMap(); - it != mAuthLLSD[grid].endMap(); ++it) - { - names.insert(it->first); - } -} - -void AuthenticationModel::getPassword(const std::string &grid, const std::string &accountName, - std::string &password) -{ - password = mAuthLLSD[grid][accountName].asString(); -} - -void AuthenticationModel::requestUpdate() -{ - mEventUpdate(); -} -- cgit v1.1