some small refactoring of the LoginService to allow sub classes to override the LLSD login authentication
parent
f278dee5cd
commit
2cb30b3435
|
@ -323,6 +323,21 @@ namespace OpenSim.Framework.Communications
|
||||||
return GoodLogin;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Called when we receive the client's initial LLSD login_to_simulator request message
|
/// Called when we receive the client's initial LLSD login_to_simulator request message
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -359,23 +374,15 @@ namespace OpenSim.Framework.Communications
|
||||||
}
|
}
|
||||||
m_log.Info("[LOGIN]: LLSD Login Requested for: '" + firstname+"' '"+lastname+"' / "+passwd);
|
m_log.Info("[LOGIN]: LLSD Login Requested for: '" + firstname+"' '"+lastname+"' / "+passwd);
|
||||||
|
|
||||||
userProfile = GetTheUser(firstname, lastname);
|
if (!TryAuthenticateLLSDLogin( firstname, lastname, passwd, out userProfile))
|
||||||
if (userProfile == null)
|
|
||||||
{
|
|
||||||
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();
|
return logResponse.CreateLoginFailedResponseLLSD();
|
||||||
}
|
}
|
||||||
else if (userProfile.GodLevel < m_minLoginLevel)
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (userProfile.GodLevel < m_minLoginLevel)
|
||||||
{
|
{
|
||||||
return logResponse.CreateLoginBlockedResponseLLSD();
|
return logResponse.CreateLoginBlockedResponseLLSD();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue