Advertisement
Guest User

Untitled

a guest
Jul 31st, 2015
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. public class CAPILoginFilter : ActionFilterAttribute
  2. {
  3. public override void OnActionExecuting(HttpActionContext i_actionContext)
  4. {
  5. CRequestBase request = (CRequestBase)i_actionContext.ActionArguments["i_request"];
  6.  
  7. CCAccount account = CAPILogin.AccountIDGetOBJ(request.UserName, request.Password);
  8.  
  9. if(account == null)
  10. {
  11. throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.Unauthorized));
  12. }
  13. else
  14. {
  15. //return account object to calling method here
  16. }
  17.  
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement