Exemple #1
0
 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())); }
 }
Exemple #2
0
 public async Task <JsonResult> SLInsert()
 {
     try
     {
         var id   = Guid.Parse(Request.Form["id"]);
         var cid  = Guid.Parse(Request.Form["cid"]);
         var code = Request.Form["code"];
         //get url using asp.net
         var url = Request.Form["url"];
         var oid = Guid.Parse(Request.Form["oid"]);
         //check if emailAddress user.ID == oid
         if (SecurityLinksService.Insert(id, cid, url + code, oid))
         {
             return(Success(id.ToString()));
         }
         return(Failed(MessageUtilityService.ContactAdmin("updating this content")));
     } catch { return(Failed(MessageUtilityService.ServerError())); }
 }
Exemple #3
0
 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())); }
 }