1 19 20 package com.sslexplorer.security.forms; 21 22 import org.apache.struts.action.ActionMapping; 23 24 import com.sslexplorer.core.forms.CoreForm; 25 import com.sslexplorer.security.IpRestriction; 26 27 33 public class ShowIpRestrictionsForm extends CoreForm { 34 35 IpRestriction[] ipRestrictions; 36 String ipAddress; 37 String action; 38 39 public void initialize(IpRestriction[] ipRestrictions) { 40 this.ipRestrictions = ipRestrictions; 41 } 42 43 public String getAddress() { 44 return ipAddress; 45 } 46 47 public IpRestriction[] getRestrictions() { 48 return ipRestrictions; 49 } 50 51 public void setAddress(String ipAddress) { 52 this.ipAddress = ipAddress; 53 } 54 55 public void setAction(String action) { 56 this.action = action; 57 } 58 59 public boolean isAuthorized() { 60 return action != null && action.equals("allow"); 61 } 62 63 public boolean isDisplayable() { 64 return ipRestrictions.length > 0; 65 } 66 67 public String getAction() { 68 return action; 69 } 70 71 public void reset(ActionMapping mapping, javax.servlet.http.HttpServletRequest request) { 72 73 ipRestrictions = null; 74 action = ""; 75 ipAddress = ""; 76 } 77 78 } | Popular Tags |