From 281ad1251ced13931ddbf99671841ef87db6ec0a Mon Sep 17 00:00:00 2001 From: Rob Smart Date: Wed, 16 Sep 2009 13:34:14 +0100 Subject: updated the IAuthorizationService interface so that a message is passed back and can be displayed at the client when an avatar is denied access to a region --- OpenSim/Services/AuthorizationService/AuthorizationService.cs | 3 ++- .../Connectors/Authorization/AuthorizationServiceConnector.cs | 4 +++- OpenSim/Services/Interfaces/IAuthorizationService.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) (limited to 'OpenSim/Services') diff --git a/OpenSim/Services/AuthorizationService/AuthorizationService.cs b/OpenSim/Services/AuthorizationService/AuthorizationService.cs index c795ba0..d658368 100644 --- a/OpenSim/Services/AuthorizationService/AuthorizationService.cs +++ b/OpenSim/Services/AuthorizationService/AuthorizationService.cs @@ -48,8 +48,9 @@ namespace OpenSim.Services.AuthorizationService m_log.Info("[AUTHORIZATION CONNECTOR]: Local Authorization service enabled"); } - public bool IsAuthorizedForRegion(string userID, string regionID) + public bool IsAuthorizedForRegion(string userID, string regionID, out string message) { + message = "Authorized"; return true; } } diff --git a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs index 98309f1..3167352 100644 --- a/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs +++ b/OpenSim/Services/Connectors/Authorization/AuthorizationServiceConnector.cs @@ -88,7 +88,7 @@ namespace OpenSim.Services.Connectors m_ResponseOnFailure = responseOnFailure; } - public bool IsAuthorizedForRegion(string userID, string firstname, string surname, string email, string regionName, string regionID) + public bool IsAuthorizedForRegion(string userID, string firstname, string surname, string email, string regionName, string regionID, out string message) { // do a remote call to the authorization server specified in the AuthorizationServerURI m_log.InfoFormat("[AUTHORIZATION CONNECTOR]: IsAuthorizedForRegion checking {0} at remote server {1}", userID, m_ServerURI); @@ -105,10 +105,12 @@ namespace OpenSim.Services.Connectors catch (Exception e) { m_log.WarnFormat("[AUTHORIZATION CONNECTOR]: Unable to send authorize {0} for region {1} error thrown during comms with remote server. Reason: {2}", userID, regionID, e.Message); + message=""; return m_ResponseOnFailure; } m_log.DebugFormat("[AUTHORIZATION CONNECTOR] response from remote service was {0}", response.Message); + message = response.Message; return response.IsAuthorized; } diff --git a/OpenSim/Services/Interfaces/IAuthorizationService.cs b/OpenSim/Services/Interfaces/IAuthorizationService.cs index 91afa9a..c5d577a 100644 --- a/OpenSim/Services/Interfaces/IAuthorizationService.cs +++ b/OpenSim/Services/Interfaces/IAuthorizationService.cs @@ -40,7 +40,7 @@ namespace OpenSim.Services.Interfaces // This method returns a simple true false indicating // whether or not a user has access to the region // - bool IsAuthorizedForRegion(string userID, string regionID); + bool IsAuthorizedForRegion(string userID, string regionID, out string message); } -- cgit v1.1