public async Task <JsonResult> SLAuthIsAllowAccess() { try { var uemail = Request.Form["email"]; var url = Request.Form["url"]; var data = UsersService.GetByEmailAddress(uemail); var dataLink = SecurityLinksService.GetByURL(url); if (data != null && dataLink != null && dataLink.OwnerID == data.ID) { //update access into true SecurityLinksService.Remove(dataLink.ID); UsersService.UpdateIsAllowAccess(data.ID, true); return(Success("Success Authorizing this account!")); } return(Failed(MessageUtilityService.ContactAdmin("content"))); } catch { return(Failed(MessageUtilityService.ServerError())); } }
public async Task <JsonResult> SLAuthUser() { try { var url = Request.Form["url"]; var email = Request.Form["email"]; var newPassword = Request.Form["npass"]; var data = UsersService.GetByEmailAddress(email); var dataLink = SecurityLinksService.GetByURL(url); if (data != null && dataLink != null && dataLink.OwnerID == data.ID) { if (UsersService.UpdatePassword(data.ID, UsersService.GenerateHashPassword(newPassword))) { SecurityLinksService.Remove(dataLink.ID); return(Success("Success Updating Password")); } } return(Failed(MessageUtilityService.ContactAdmin("content"))); } catch { return(Failed(MessageUtilityService.ServerError())); } }