aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Framework
diff options
context:
space:
mode:
authorMelanie2010-07-08 17:32:57 +0100
committerMelanie2010-07-08 17:32:57 +0100
commit5f400a50beb2b9d523e5a0fac643ca1cb247c9a6 (patch)
treeda874e34ef1c790f9b8ce9dc0533ac98755d783c /OpenSim/Region/CoreModules/Framework
parentminimizes temp garbage for llParseStringKeepNulls() (diff)
parentllVecNorm() now returns a zero-length vector when one is supplied as input. A... (diff)
downloadopensim-SC-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.zip
opensim-SC-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.tar.gz
opensim-SC-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.tar.bz2
opensim-SC-5f400a50beb2b9d523e5a0fac643ca1cb247c9a6.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/CoreModules/Framework')
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs2
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs22
-rw-r--r--OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs59
3 files changed, 78 insertions, 5 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
index c1e92f5..b13b9d8 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGAssetMapper.cs
@@ -157,6 +157,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
157 Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>(); 157 Dictionary<UUID, AssetType> ids = new Dictionary<UUID, AssetType>();
158 HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL); 158 HGUuidGatherer uuidGatherer = new HGUuidGatherer(this, m_scene.AssetService, userAssetURL);
159 uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids); 159 uuidGatherer.GatherAssetUuids(asset.FullID, (AssetType)asset.Type, ids);
160 if (ids.ContainsKey(assetID))
161 ids.Remove(assetID);
160 foreach (UUID uuid in ids.Keys) 162 foreach (UUID uuid in ids.Keys)
161 FetchAsset(userAssetURL, uuid); 163 FetchAsset(userAssetURL, uuid);
162 164
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
index b0555da..8ccc941 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/HGInventoryAccessModule.cs
@@ -131,7 +131,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
131 return ret; 131 return ret;
132 } 132 }
133 133
134 // DO NOT OVERRIDE THIS METHOD 134 // DO NOT OVERRIDE THE BASE METHOD
135 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID, 135 public virtual UUID DeleteToInventory(DeRezAction action, UUID folderID,
136 SceneObjectGroup objectGroup, IClientAPI remoteClient) 136 SceneObjectGroup objectGroup, IClientAPI remoteClient)
137 { 137 {
@@ -139,7 +139,8 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
139 139
140 if (!assetID.Equals(UUID.Zero)) 140 if (!assetID.Equals(UUID.Zero))
141 { 141 {
142 UploadInventoryItem(remoteClient.AgentId, assetID, "", 0); 142 if (remoteClient != null)
143 UploadInventoryItem(remoteClient.AgentId, assetID, "", 0);
143 } 144 }
144 else 145 else
145 m_log.Debug("[HGScene]: Scene.Inventory did not create asset"); 146 m_log.Debug("[HGScene]: Scene.Inventory did not create asset");
@@ -192,9 +193,7 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
192 m_assMapper.Post(item.AssetID, receiver, userAssetServer); 193 m_assMapper.Post(item.AssetID, receiver, userAssetServer);
193 } 194 }
194 195
195 #endregion 196 public override bool IsForeignUser(UUID userID, out string assetServerURL)
196
197 public bool IsForeignUser(UUID userID, out string assetServerURL)
198 { 197 {
199 assetServerURL = string.Empty; 198 assetServerURL = string.Empty;
200 UserAccount account = null; 199 UserAccount account = null;
@@ -217,5 +216,18 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
217 216
218 return false; 217 return false;
219 } 218 }
219
220 #endregion
221
222 protected override InventoryItemBase GetItem(UUID agentID, UUID itemID)
223 {
224 InventoryItemBase item = base.GetItem(agentID, itemID);
225
226 string userAssetServer = string.Empty;
227 if (IsForeignUser(agentID, out userAssetServer))
228 m_assMapper.Get(item.AssetID, agentID, userAssetServer);
229
230 return item;
231 }
220 } 232 }
221} 233}
diff --git a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
index 12b6aa0..90b7b51 100644
--- a/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
+++ b/OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs
@@ -639,6 +639,57 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
639 { 639 {
640 } 640 }
641 641
642 public virtual bool GetAgentInventoryItem(IClientAPI remoteClient, UUID itemID, UUID requestID)
643 {
644 InventoryItemBase assetRequestItem = GetItem(remoteClient.AgentId, itemID);
645 if (assetRequestItem == null)
646 {
647 ILibraryService lib = m_Scene.RequestModuleInterface<ILibraryService>();
648 if (lib != null)
649 assetRequestItem = lib.LibraryRootFolder.FindItem(itemID);
650 if (assetRequestItem == null)
651 return false;
652 }
653
654 // At this point, we need to apply perms
655 // only to notecards and scripts. All
656 // other asset types are always available
657 //
658 if (assetRequestItem.AssetType == (int)AssetType.LSLText)
659 {
660 if (!m_Scene.Permissions.CanViewScript(itemID, UUID.Zero, remoteClient.AgentId))
661 {
662 remoteClient.SendAgentAlertMessage("Insufficient permissions to view script", false);
663 return false;
664 }
665 }
666 else if (assetRequestItem.AssetType == (int)AssetType.Notecard)
667 {
668 if (!m_Scene.Permissions.CanViewNotecard(itemID, UUID.Zero, remoteClient.AgentId))
669 {
670 remoteClient.SendAgentAlertMessage("Insufficient permissions to view notecard", false);
671 return false;
672 }
673 }
674
675 if (assetRequestItem.AssetID != requestID)
676 {
677 m_log.WarnFormat(
678 "[CLIENT]: {0} requested asset {1} from item {2} but this does not match item's asset {3}",
679 Name, requestID, itemID, assetRequestItem.AssetID);
680 return false;
681 }
682
683 return true;
684 }
685
686
687 public virtual bool IsForeignUser(UUID userID, out string assetServerURL)
688 {
689 assetServerURL = string.Empty;
690 return false;
691 }
692
642 #endregion 693 #endregion
643 694
644 #region Misc 695 #region Misc
@@ -661,6 +712,14 @@ namespace OpenSim.Region.CoreModules.Framework.InventoryAccess
661 return asset; 712 return asset;
662 } 713 }
663 714
715 protected virtual InventoryItemBase GetItem(UUID agentID, UUID itemID)
716 {
717 IInventoryService invService = m_Scene.RequestModuleInterface<IInventoryService>();
718 InventoryItemBase assetRequestItem = new InventoryItemBase(itemID, agentID);
719 assetRequestItem = invService.GetItem(assetRequestItem);
720 return assetRequestItem;
721 }
722
664 #endregion 723 #endregion
665 } 724 }
666} 725}