public string InventoryUploadRequest(Environment env, string pathtofile) { if (!m_WebApp.IsInstalled) { m_log.DebugFormat("[Wifi]: warning: someone is trying to access InventoryPostRequest and Wifi isn't installed!"); return(m_WebApp.ReadFile(env, "index.html")); } m_log.DebugFormat("[Wifi]: InventoryPostRequest"); Request request = env.TheRequest; SessionInfo sinfo; if (TryGetSessionInfo(request, out sinfo)) { env.Session = sinfo; if (sinfo.Account.UserLevel >= m_WebApp.IARUserLevel) { InventoryArchiveReader reader = new InventoryArchiveReader(m_InventoryService, m_AssetService, m_UserAccountService, sinfo.Account, "/", pathtofile, true); reader.Execute(); } // Send the [new] inventory list return(InventoryLoadGetRequest(env)); } else { return(m_WebApp.ReadFile(env, "index.html")); } }
public string InventoryUploadRequest(Environment env, string pathtofile) { if (!m_WebApp.IsInstalled) { m_log.DebugFormat("[Wifi]: warning: someone is trying to access InventoryPostRequest and Wifi isn't installed!"); return m_WebApp.ReadFile(env, "index.html"); } m_log.DebugFormat("[Wifi]: InventoryPostRequest"); Request request = env.TheRequest; SessionInfo sinfo; if (TryGetSessionInfo(request, out sinfo)) { env.Session = sinfo; if (sinfo.Account.UserLevel >= m_WebApp.IARUserLevel) { InventoryArchiveReader reader = new InventoryArchiveReader(m_InventoryService, m_AssetService, m_UserAccountService, sinfo.Account, "/", pathtofile, true); reader.Execute(); } // Send the [new] inventory list return InventoryLoadGetRequest(env); } else { return m_WebApp.ReadFile(env, "index.html"); } }