void ResetForm() { CurrentUserName.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentUserName.Clear(); }); CurrentChatRoom.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentChatRoom.Clear(); }); CurrentUserName.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentUserName.AppendText("Current User Name: " + SetNameTextBox.Text + "."); }); CurrentChatRoom.BeginInvoke((System.Windows.Forms.MethodInvoker) delegate() { CurrentChatRoom.AppendText("Current Chat Room: " + ChatRoomName.Text + "."); }); }
public static void LogoutCurrentUser(String redirectUrl) { if (!CurrentUserName.IsNullOrEmpty()) { HttpContext.Current.Response.Cookies[FormsAuthentication.FormsCookieName].Expires = DateTime.Now; FormsAuthentication.SignOut(); } if (!redirectUrl.IsNullOrEmpty()) { HttpContext.Current.Response.Redirect(redirectUrl); } else { HttpContext.Current.Response.Redirect(HttpContext.Current.Request.Url.PathAndQuery); } }
public async Task <IActionResult> CreateOrUpdateUser([FromBody] ProfileCRUDDTO profile) { if (string.IsNullOrEmpty(CurrentUserName)) { return(Unauthorized()); } if (!CurrentUserName.Equals(profile.Mobile)) { return(Unauthorized()); } profile.IdentityUserId = IdentityUserId; profile.Username = CurrentUserName; var result = await _profileService.CreateOrUpdateUserProfileAsync(profile); result.IsDoctor = User.IsInRole("doctor"); return(Ok(result)); }
public bool CanCurrentUserPostNews() { return(CurrentUserName.Equals("heislenger") || CurrentUserName.Equals("alegre") || !CanBeHacked(CurrentUser)); }