static public int?PersonId() { string sessionId = String.Empty; try { // Todo: Track down and consolidate all forms of session id being passed into the webservice. sessionId = System.Web.HttpContext.Current.Request.Params["sessionid"]; if (String.IsNullOrEmpty(sessionId)) { sessionId = System.Web.HttpContext.Current.Request.Params["session_id"]; if (String.IsNullOrEmpty(sessionId)) { sessionId = System.Web.HttpContext.Current.Request.Params["sid"]; if (String.IsNullOrEmpty(sessionId)) { sessionId = System.Web.HttpContext.Current.Request.Params["api_session"]; } } } if (!String.IsNullOrEmpty(sessionId)) { return(SessionAPI.GetPersonIdBySessionId(System.Web.HttpContext.Current.Request.Params["sessionid"])); } else { return(null); } } catch { return(null); } }
static public string PersonName() { string sessionId = String.Empty; string apiKey = String.Empty; try { // Todo: Track down and consolidate all forms of session id being passed into the webservice. sessionId = System.Web.HttpContext.Current.Request.Params["sessionid"]; if (String.IsNullOrEmpty(sessionId)) { sessionId = System.Web.HttpContext.Current.Request.Params["session_id"]; if (String.IsNullOrEmpty(sessionId)) { sessionId = System.Web.HttpContext.Current.Request.Params["sid"]; if (String.IsNullOrEmpty(sessionId)) { sessionId = System.Web.HttpContext.Current.Request.Params["api_session"]; if (String.IsNullOrEmpty(sessionId)) { sessionId = System.Web.HttpContext.Current.Request.Params["sessionid"]; if (String.IsNullOrEmpty(apiKey)) { apiKey = System.Web.HttpContext.Current.Request.Params["apikey"]; if (String.IsNullOrEmpty(apiKey)) { apiKey = System.Web.HttpContext.Current.Request.Params["api_key"]; if (String.IsNullOrEmpty(apiKey)) { apiKey = System.Web.HttpContext.Current.Request.Params["key"]; } } } } } } } if (!String.IsNullOrEmpty(sessionId)) { return(SessionAPI.GetPersonNameBySessionId(sessionId)); } else if (!String.IsNullOrEmpty(apiKey)) { return(SessionAPI.GetPersonNameByApiKey(apiKey)); } else { return("Anonymous"); } } catch { return("Session was not found."); } }