diff options
author | MW | 2008-12-05 10:31:34 +0000 |
---|---|---|
committer | MW | 2008-12-05 10:31:34 +0000 |
commit | 2cb30b3435e79f60f153fb03fc01a0639de73152 (patch) | |
tree | c1b77e56f6001f9cd83c73094a2381948abccd99 /OpenSim/Framework/Communications/LoginService.cs | |
parent | Update svn properties. (diff) | |
download | opensim-SC_OLD-2cb30b3435e79f60f153fb03fc01a0639de73152.zip opensim-SC_OLD-2cb30b3435e79f60f153fb03fc01a0639de73152.tar.gz opensim-SC_OLD-2cb30b3435e79f60f153fb03fc01a0639de73152.tar.bz2 opensim-SC_OLD-2cb30b3435e79f60f153fb03fc01a0639de73152.tar.xz |
some small refactoring of the LoginService to allow sub classes to override the LLSD login authentication
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Framework/Communications/LoginService.cs | 29 |
1 files changed, 18 insertions, 11 deletions
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 | |||
323 | return GoodLogin; | 323 | return GoodLogin; |
324 | } | 324 | } |
325 | 325 | ||
326 | protected virtual bool TryAuthenticateLLSDLogin( string firstname, string lastname, string passwd, out UserProfileData userProfile) | ||
327 | { | ||
328 | bool GoodLogin = false; | ||
329 | userProfile = GetTheUser(firstname, lastname); | ||
330 | if (userProfile == null) | ||
331 | { | ||
332 | m_log.Info("[LOGIN]: LLSD Could not find a profile for " + firstname + " " + lastname); | ||
333 | |||
334 | return false; | ||
335 | } | ||
336 | |||
337 | GoodLogin = AuthenticateUser(userProfile, passwd); | ||
338 | return GoodLogin; | ||
339 | } | ||
340 | |||
326 | /// <summary> | 341 | /// <summary> |
327 | /// Called when we receive the client's initial LLSD login_to_simulator request message | 342 | /// Called when we receive the client's initial LLSD login_to_simulator request message |
328 | /// </summary> | 343 | /// </summary> |
@@ -359,23 +374,15 @@ namespace OpenSim.Framework.Communications | |||
359 | } | 374 | } |
360 | m_log.Info("[LOGIN]: LLSD Login Requested for: '" + firstname+"' '"+lastname+"' / "+passwd); | 375 | m_log.Info("[LOGIN]: LLSD Login Requested for: '" + firstname+"' '"+lastname+"' / "+passwd); |
361 | 376 | ||
362 | userProfile = GetTheUser(firstname, lastname); | 377 | if (!TryAuthenticateLLSDLogin( firstname, lastname, passwd, out userProfile)) |
363 | if (userProfile == null) | ||
364 | { | 378 | { |
365 | m_log.Info("[LOGIN]: LLSD Could not find a profile for " + firstname + " " + lastname); | ||
366 | |||
367 | return logResponse.CreateLoginFailedResponseLLSD(); | 379 | return logResponse.CreateLoginFailedResponseLLSD(); |
368 | } | 380 | } |
369 | |||
370 | GoodLogin = AuthenticateUser(userProfile, passwd); | ||
371 | } | 381 | } |
372 | } | 382 | } |
373 | 383 | ||
374 | if (!GoodLogin) | 384 | |
375 | { | 385 | if (userProfile.GodLevel < m_minLoginLevel) |
376 | return logResponse.CreateLoginFailedResponseLLSD(); | ||
377 | } | ||
378 | else if (userProfile.GodLevel < m_minLoginLevel) | ||
379 | { | 386 | { |
380 | return logResponse.CreateLoginBlockedResponseLLSD(); | 387 | return logResponse.CreateLoginBlockedResponseLLSD(); |
381 | } | 388 | } |