aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Server/Handlers/Inventory
diff options
context:
space:
mode:
authorDiva Canto2010-01-31 11:10:57 -0800
committerDiva Canto2010-01-31 11:10:57 -0800
commit40d8e91008b7d76ce6b9398484c591eb51c85bdb (patch)
tree7851807bee519bcae508f77e11107c7ed1e99ae9 /OpenSim/Server/Handlers/Inventory
parentAdded missing file. (diff)
downloadopensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.zip
opensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.tar.gz
opensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.tar.bz2
opensim-SC_OLD-40d8e91008b7d76ce6b9398484c591eb51c85bdb.tar.xz
* Added a few files that were missing in the repo.
* New HGInventoryService which allows restricted access to inventory while outside
Diffstat (limited to 'OpenSim/Server/Handlers/Inventory')
-rw-r--r--OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs46
1 files changed, 5 insertions, 41 deletions
diff --git a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
index 3c92209..53db739 100644
--- a/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
+++ b/OpenSim/Server/Handlers/Inventory/InventoryServerInConnector.cs
@@ -46,7 +46,7 @@ namespace OpenSim.Server.Handlers.Inventory
46 { 46 {
47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 47 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
48 48
49 private IInventoryService m_InventoryService; 49 protected IInventoryService m_InventoryService;
50 50
51 private bool m_doLookup = false; 51 private bool m_doLookup = false;
52 52
@@ -54,11 +54,12 @@ namespace OpenSim.Server.Handlers.Inventory
54 //private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME); 54 //private AuthedSessionCache m_session_cache = new AuthedSessionCache(INVENTORY_DEFAULT_SESSION_TIME);
55 55
56 private string m_userserver_url; 56 private string m_userserver_url;
57 private string m_ConfigName = "InventoryService"; 57 protected string m_ConfigName = "InventoryService";
58 58
59 public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) : 59 public InventoryServiceInConnector(IConfigSource config, IHttpServer server, string configName) :
60 base(config, server, configName) 60 base(config, server, configName)
61 { 61 {
62 m_ConfigName = configName;
62 IConfig serverConfig = config.Configs[m_ConfigName]; 63 IConfig serverConfig = config.Configs[m_ConfigName];
63 if (serverConfig == null) 64 if (serverConfig == null)
64 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName)); 65 throw new Exception(String.Format("No section '{0}' in config file", m_ConfigName));
@@ -328,46 +329,9 @@ namespace OpenSim.Server.Handlers.Inventory
328 /// <param name="session_id"></param> 329 /// <param name="session_id"></param>
329 /// <param name="avatar_id"></param> 330 /// <param name="avatar_id"></param>
330 /// <returns></returns> 331 /// <returns></returns>
331 public bool CheckAuthSession(string session_id, string avatar_id) 332 public virtual bool CheckAuthSession(string session_id, string avatar_id)
332 { 333 {
333 if (m_doLookup) 334 return true;
334 {
335 m_log.InfoFormat("[INVENTORY IN CONNECTOR]: checking authed session {0} {1}", session_id, avatar_id);
336
337 //if (m_session_cache.getCachedSession(session_id, avatar_id) == null)
338 //{
339 // cache miss, ask userserver
340 Hashtable requestData = new Hashtable();
341 requestData["avatar_uuid"] = avatar_id;
342 requestData["session_id"] = session_id;
343 ArrayList SendParams = new ArrayList();
344 SendParams.Add(requestData);
345 XmlRpcRequest UserReq = new XmlRpcRequest("check_auth_session", SendParams);
346 XmlRpcResponse UserResp = UserReq.Send(m_userserver_url, 3000);
347
348 Hashtable responseData = (Hashtable)UserResp.Value;
349 if (responseData.ContainsKey("auth_session") && responseData["auth_session"].ToString() == "TRUE")
350 {
351 m_log.Info("[INVENTORY IN CONNECTOR]: got authed session from userserver");
352 //// add to cache; the session time will be automatically renewed
353 //m_session_cache.Add(session_id, avatar_id);
354 return true;
355 }
356 //}
357 //else
358 //{
359 // // cache hits
360 // m_log.Info("[GRID AGENT INVENTORY]: got authed session from cache");
361 // return true;
362 //}
363
364 m_log.Warn("[INVENTORY IN CONNECTOR]: unknown session_id, request rejected");
365 return false;
366 }
367 else
368 {
369 return true;
370 }
371 } 335 }
372 336
373 } 337 }