public void Logout() { HttpCookie impersonateCookie = Request.Cookies[sSnCoreImpersonateCookieName]; if (impersonateCookie != null) { Login(impersonateCookie.Value, false); Response.Cookies[sSnCoreImpersonateCookieName].Value = string.Empty; Response.Cookies[sSnCoreImpersonateCookieName].Expires = new DateTime(1970, 1, 1); return; } if (IsLoggedIn) { Cache.Remove(string.Format("ticket:{0}", Ticket)); Cache.Remove(string.Format("account:{0}", Ticket)); Cache.Remove(string.Format("accountpermissions:{0}", Ticket)); Response.Cookies[sSnCoreAuthCookieName].Value = string.Empty; Response.Cookies[sSnCoreAuthCookieName].Expires = new DateTime(1970, 1, 1); mTicket = string.Empty; mAccount = null; } }
public string Handle(string tag, string tagname, string tagvalue) { if ((tagname == "user") || (tagname == "account")) { int userid = 0; if (int.TryParse(tagvalue, out userid)) { AccountService.TransitAccount t_account = GetInstance <AccountService.TransitAccount, AccountService.ServiceQueryOptions, int>( userid, AccountService.GetAccountById); if (t_account != null) { return(string.Format("<a href=\"{0}/AccountView.aspx?id={1}\">{2}</a>", WebsiteUrl, t_account.Id, Renderer.Render(t_account.Name))); } } return(string.Format("[invalid user: {0}]", tagvalue)); } else { PlaceService.TransitPlace p = GetInstance <PlaceService.TransitPlace, PlaceService.ServiceQueryOptions, string, string>( tagname, tagvalue, PlaceService.FindPlace); if (p == null) { return(string.Format("<a href=\"{3}/PlaceView.aspx?city={0}&name={1}\">{2}</a>", Renderer.UrlEncode(tagname), Renderer.UrlEncode(tagvalue), Renderer.Render(tagvalue), WebsiteUrl)); } else { return(string.Format("<a href=\"{2}/PlaceView.aspx?id={0}\">{1}</a>", p.Id, Renderer.Render(p.Name), WebsiteUrl)); } } }
public LocationEventArgs(AccountService.TransitAccount account) : this(account.Country, account.State, account.City, string.Empty /* TODO */) { }
public LocationWithOptionsEventArgs(AccountService.TransitAccount account) : base(account) { }