Don't try and resolve user account for authorization if the agent has come in via hypergrid.

If a user account isn't available, this just passes on the name given by the agent instead.
I'm not sure this is particularly useful since I believe that agent names could be faked in this context - it might be no more useful than a viewer agent string.
In fact, there might even be an argument that passing on this name provides a false expectation of authenticity.  However, I will apply for now.
Patch applied from http://opensimulator.org/mantis/view.php?id=5696
Thanks Michelle Argus.
remove-scene-viewer
Justin Clark-Casey (justincc) 2011-09-24 01:39:37 +01:00
parent 839c1cdcc4
commit c14c4bc1ec
1 changed files with 11 additions and 1 deletions

View File

@ -141,11 +141,21 @@ namespace OpenSim.Region.CoreModules.ServiceConnectorsOut.Authorization
if (scene != null) if (scene != null)
{ {
string mail = String.Empty;
UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, new UUID(userID)); UserAccount account = scene.UserAccountService.GetUserAccount(UUID.Zero, new UUID(userID));
//if account not found, we assume its a foreign visitor from HG, else use account data...
if (account != null)
{
mail = account.Email;
firstName = account.FirstName;
lastName = account.LastName;
}
isAuthorized isAuthorized
= IsAuthorizedForRegion( = IsAuthorizedForRegion(
userID, firstName, lastName, account.Email, scene.RegionInfo.RegionName, regionID, out message); userID, firstName, lastName, mail, scene.RegionInfo.RegionName, regionID, out message);
} }
else else
{ {