From 2cb30b3435e79f60f153fb03fc01a0639de73152 Mon Sep 17 00:00:00 2001 From: MW Date: Fri, 5 Dec 2008 10:31:34 +0000 Subject: some small refactoring of the LoginService to allow sub classes to override the LLSD login authentication --- OpenSim/Framework/Communications/LoginService.cs | 29 +++++++++++++++--------- 1 file changed, 18 insertions(+), 11 deletions(-) (limited to 'OpenSim/Framework/Communications') diff --git a/OpenSim/Framework/Communications/LoginService.cs b/OpenSim/Framework/Communications/LoginService.cs index e4e00a7..90c5206 100644 --- a/OpenSim/Framework/Communications/LoginService.cs +++ b/OpenSim/Framework/Communications/LoginService.cs @@ -323,6 +323,21 @@ namespace OpenSim.Framework.Communications return GoodLogin; } + protected virtual bool TryAuthenticateLLSDLogin( string firstname, string lastname, string passwd, out UserProfileData userProfile) + { + bool GoodLogin = false; + userProfile = GetTheUser(firstname, lastname); + if (userProfile == null) + { + m_log.Info("[LOGIN]: LLSD Could not find a profile for " + firstname + " " + lastname); + + return false; + } + + GoodLogin = AuthenticateUser(userProfile, passwd); + return GoodLogin; + } + /// /// Called when we receive the client's initial LLSD login_to_simulator request message /// @@ -359,23 +374,15 @@ namespace OpenSim.Framework.Communications } m_log.Info("[LOGIN]: LLSD Login Requested for: '" + firstname+"' '"+lastname+"' / "+passwd); - userProfile = GetTheUser(firstname, lastname); - if (userProfile == null) + if (!TryAuthenticateLLSDLogin( firstname, lastname, passwd, out userProfile)) { - m_log.Info("[LOGIN]: LLSD Could not find a profile for " + firstname + " " + lastname); - return logResponse.CreateLoginFailedResponseLLSD(); } - - GoodLogin = AuthenticateUser(userProfile, passwd); } } - if (!GoodLogin) - { - return logResponse.CreateLoginFailedResponseLLSD(); - } - else if (userProfile.GodLevel < m_minLoginLevel) + + if (userProfile.GodLevel < m_minLoginLevel) { return logResponse.CreateLoginBlockedResponseLLSD(); } -- cgit v1.1