public ActionResult GenerateUserIcon() { var m = new Models.UserIconModel(); m.Greetings = User.Identity.GetUserName(); m.UserLabel = m.Greetings; var ci = User.Identity as System.Security.Claims.ClaimsIdentity; string strIcon = (from d in ci.Claims where d.Type == CustomClaims.HasIcon select d.Value).SingleOrDefault(); bool hasIcon; if (!string.IsNullOrEmpty(strIcon) && bool.TryParse(strIcon, out hasIcon) && hasIcon) { m.IconUrl = "Account/GetMemberIcon?id=" + User.Identity.GetUserId(); } return(PartialView("_UserIconPartial", m)); }
public ActionResult GenerateUserIcon() { var m = new Models.UserIconModel(); m.Greetings = User.Identity.GetUserName(); m.UserLabel = m.Greetings; var ci = User.Identity as System.Security.Claims.ClaimsIdentity; string strIcon = (from d in ci.Claims where d.Type == CustomClaims.HasIcon select d.Value).SingleOrDefault(); bool hasIcon; if (!string.IsNullOrEmpty(strIcon) && bool.TryParse(strIcon, out hasIcon) && hasIcon) { m.IconUrl = "Account/GetMemberIcon?id=" + User.Identity.GetUserId(); } #if NO_SIGNALR m.Notifications = false; #else string enable = ConfigurationManager.AppSettings["EnableSignalR"]; m.Notifications = bool.Parse(enable); #endif return(PartialView("_UserIconPartial", m)); }
public ActionResult GenerateUserIcon() { var m = new Models.UserIconModel(); m.Greetings = User.Identity.GetUserName(); m.UserLabel = m.Greetings; var ci = User.Identity as System.Security.Claims.ClaimsIdentity; string strIcon = (from d in ci.Claims where d.Type == CustomClaims.HasIcon select d.Value).SingleOrDefault(); bool hasIcon; if (!string.IsNullOrEmpty(strIcon) && bool.TryParse(strIcon, out hasIcon) && hasIcon) m.IconUrl = "Account/GetMemberIcon?id=" + User.Identity.GetUserId(); return PartialView("_UserIconPartial", m); }
public ActionResult GenerateUserIcon() { var m = new Models.UserIconModel(); m.Greetings = User.Identity.GetUserName(); m.UserLabel = m.Greetings; var ci = User.Identity as System.Security.Claims.ClaimsIdentity; string strIcon = (from d in ci.Claims where d.Type == CustomClaims.HasIcon select d.Value).SingleOrDefault(); bool hasIcon; if (!string.IsNullOrEmpty(strIcon) && bool.TryParse(strIcon, out hasIcon) && hasIcon) m.IconUrl = "Account/GetMemberIcon?id=" + User.Identity.GetUserId(); #if NO_SIGNALR m.Notifications = false; #else string enable = ConfigurationManager.AppSettings["EnableSignalR"]; m.Notifications = bool.Parse(enable); #endif return PartialView("_UserIconPartial", m); }