diff options
author | Diva Canto | 2010-01-16 21:42:44 -0800 |
---|---|---|
committer | Diva Canto | 2010-01-16 21:42:44 -0800 |
commit | 04e29c1bacbc1e2df980ae15896a847ce7535da2 (patch) | |
tree | e799d2837af1a41bc2c3b2d571201e9a8a6d7ae7 /OpenSim/Region/Framework/Scenes | |
parent | Finished moving object crossings into EntityTransferModule (diff) | |
download | opensim-SC-04e29c1bacbc1e2df980ae15896a847ce7535da2.zip opensim-SC-04e29c1bacbc1e2df980ae15896a847ce7535da2.tar.gz opensim-SC-04e29c1bacbc1e2df980ae15896a847ce7535da2.tar.bz2 opensim-SC-04e29c1bacbc1e2df980ae15896a847ce7535da2.tar.xz |
Beginning of rewriting HG. Compiles, and runs, but HG functions not restored yet.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5654f67..5730b56 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -3157,7 +3157,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3157 | agent.AgentID, agent.circuitcode, teleportFlags); | 3157 | agent.AgentID, agent.circuitcode, teleportFlags); |
3158 | 3158 | ||
3159 | reason = String.Empty; | 3159 | reason = String.Empty; |
3160 | if (!AuthenticateUser(agent, out reason)) | 3160 | if (!VerifyUserPresence(agent, out reason)) |
3161 | return false; | 3161 | return false; |
3162 | 3162 | ||
3163 | if (!AuthorizeUser(agent, out reason)) | 3163 | if (!AuthorizeUser(agent, out reason)) |
@@ -3258,30 +3258,32 @@ namespace OpenSim.Region.Framework.Scenes | |||
3258 | } | 3258 | } |
3259 | 3259 | ||
3260 | /// <summary> | 3260 | /// <summary> |
3261 | /// Verifies that the user has a session on the Grid | 3261 | /// Verifies that the user has a presence on the Grid |
3262 | /// </summary> | 3262 | /// </summary> |
3263 | /// <param name="agent">Circuit Data of the Agent we're verifying</param> | 3263 | /// <param name="agent">Circuit Data of the Agent we're verifying</param> |
3264 | /// <param name="reason">Outputs the reason for the false response on this string</param> | 3264 | /// <param name="reason">Outputs the reason for the false response on this string</param> |
3265 | /// <returns>True if the user has a session on the grid. False if it does not. False will | 3265 | /// <returns>True if the user has a session on the grid. False if it does not. False will |
3266 | /// also return a reason.</returns> | 3266 | /// also return a reason.</returns> |
3267 | public virtual bool AuthenticateUser(AgentCircuitData agent, out string reason) | 3267 | public virtual bool VerifyUserPresence(AgentCircuitData agent, out string reason) |
3268 | { | 3268 | { |
3269 | reason = String.Empty; | 3269 | reason = String.Empty; |
3270 | 3270 | ||
3271 | IAuthenticationService auth = RequestModuleInterface<IAuthenticationService>(); | 3271 | IPresenceService presence = RequestModuleInterface<IPresenceService>(); |
3272 | if (auth == null) | 3272 | if (presence == null) |
3273 | { | 3273 | { |
3274 | reason = String.Format("Failed to authenticate user {0} {1} in region {2}. Authentication service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); | 3274 | reason = String.Format("Failed to verify user {0} {1} in region {2}. Presence service does not exist.", agent.firstname, agent.lastname, RegionInfo.RegionName); |
3275 | return false; | 3275 | return false; |
3276 | } | 3276 | } |
3277 | 3277 | ||
3278 | bool result = auth.Verify(agent.AgentID, agent.SecureSessionID.ToString(), 30); | 3278 | OpenSim.Services.Interfaces.PresenceInfo pinfo = presence.GetAgent(agent.SessionID); |
3279 | 3279 | ||
3280 | m_log.Debug("[CONNECTION BEGIN]: Session authentication returned " + result); | 3280 | if (pinfo == null || (pinfo != null && pinfo.Online == false)) |
3281 | if (!result) | 3281 | { |
3282 | reason = String.Format("Failed to authenticate user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); | 3282 | reason = String.Format("Failed to verify user {0} {1}, access denied to region {2}.", agent.firstname, agent.lastname, RegionInfo.RegionName); |
3283 | return false; | ||
3284 | } | ||
3283 | 3285 | ||
3284 | return result; | 3286 | return true; |
3285 | } | 3287 | } |
3286 | 3288 | ||
3287 | /// <summary> | 3289 | /// <summary> |