Changeset - 87c8752bc175
[Not reviewed]
0 3 0
HanzZ - 14 years ago 2011-08-24 00:18:51
hanzz.k@gmail.com
Do not create users entry in getPassword
3 files changed with 3 insertions and 4 deletions:
0 comments (0 inline, 0 general)
include/transport/userregistry.h
Show inline comments
 
@@ -102,6 +102,7 @@ class UserRegistry : public Swift::UserRegistry {
 

	
 
		mutable std::map<std::string, Sess> users;
 
		mutable Config *config;
 
		std::string empty;
 
};
 

	
 
}
src/usermanager.cpp
Show inline comments
 
@@ -164,10 +164,6 @@ void UserManager::handlePresence(Swift::Presence::ref presence) {
 
			res.password = m_userRegistry->getUserPassword(userkey);
 
		}
 

	
 
		if (res.password.empty()) {
 
			m_userRegistry->onPasswordInvalid(presence->getFrom());
 
		}
 

	
 
		// Unregistered users are not able to login
 
		if (!registered) {
 
			LOG4CXX_WARN(logger, "Unregistered user " << userkey << " tried to login");
src/userregistry.cpp
Show inline comments
 
@@ -117,7 +117,9 @@ void UserRegistry::onPasswordInvalid(const Swift::JID &user) {
 
}
 

	
 
const std::string &UserRegistry::getUserPassword(const std::string &barejid) {
 
	if (users.find(barejid) != users.end())
 
		return users[barejid].password;
 
	return empty;
 
}
 

	
 
}
0 comments (0 inline, 0 general)