forked from I2P_Developers/i2p.i2p
put blacklist mode on form
This commit is contained in:
@@ -171,8 +171,12 @@ public class EditBean extends IndexBean {
|
|||||||
return getProperty(tunnel, "i2cp.leaseSetKey", "");
|
return getProperty(tunnel, "i2cp.leaseSetKey", "");
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getAccess(int tunnel) {
|
public String getAccessMode(int tunnel) {
|
||||||
return getBooleanProperty(tunnel, "i2cp.enableAccessList");
|
if (getBooleanProperty(tunnel, PROP_ENABLE_ACCESS_LIST))
|
||||||
|
return "1";
|
||||||
|
if (getBooleanProperty(tunnel, PROP_ENABLE_BLACKLIST))
|
||||||
|
return "2";
|
||||||
|
return "0";
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAccessList(int tunnel) {
|
public String getAccessList(int tunnel) {
|
||||||
|
@@ -643,9 +643,17 @@ public class IndexBean {
|
|||||||
public void setEncrypt(String moo) {
|
public void setEncrypt(String moo) {
|
||||||
_booleanOptions.add("i2cp.encryptLeaseSet");
|
_booleanOptions.add("i2cp.encryptLeaseSet");
|
||||||
}
|
}
|
||||||
public void setAccess(String moo) {
|
|
||||||
_booleanOptions.add("i2cp.enableAccessList");
|
protected static final String PROP_ENABLE_ACCESS_LIST = "i2cp.enableAccessList";
|
||||||
|
protected static final String PROP_ENABLE_BLACKLIST = "i2cp.enableBlackList";
|
||||||
|
|
||||||
|
public void setAccessMode(String val) {
|
||||||
|
if ("1".equals(val))
|
||||||
|
_booleanOptions.add(PROP_ENABLE_ACCESS_LIST);
|
||||||
|
else if ("2".equals(val))
|
||||||
|
_booleanOptions.add(PROP_ENABLE_BLACKLIST);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setDelayOpen(String moo) {
|
public void setDelayOpen(String moo) {
|
||||||
_booleanOptions.add("i2cp.delayOpen");
|
_booleanOptions.add("i2cp.delayOpen");
|
||||||
}
|
}
|
||||||
@@ -942,7 +950,7 @@ public class IndexBean {
|
|||||||
I2PTunnelHTTPClientBase.PROP_AUTH, I2PTunnelHTTPClientBase.PROP_OUTPROXY_AUTH
|
I2PTunnelHTTPClientBase.PROP_AUTH, I2PTunnelHTTPClientBase.PROP_OUTPROXY_AUTH
|
||||||
};
|
};
|
||||||
private static final String _booleanServerOpts[] = {
|
private static final String _booleanServerOpts[] = {
|
||||||
"i2cp.reduceOnIdle", "i2cp.encryptLeaseSet", "i2cp.enableAccessList"
|
"i2cp.reduceOnIdle", "i2cp.encryptLeaseSet", PROP_ENABLE_ACCESS_LIST, PROP_ENABLE_BLACKLIST
|
||||||
};
|
};
|
||||||
private static final String _otherClientOpts[] = {
|
private static final String _otherClientOpts[] = {
|
||||||
"i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.closeIdleTime",
|
"i2cp.reduceIdleTime", "i2cp.reduceQuantity", "i2cp.closeIdleTime",
|
||||||
|
@@ -359,17 +359,18 @@
|
|||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
<div id="portField" class="rowItem">
|
<div id="portField" class="rowItem">
|
||||||
<label for="access" accesskey="s">
|
<label><%=intl._("Disable")%></label>
|
||||||
<%=intl._("Enable")%>:
|
<input value="0" type="radio" id="startOnLoad" name="accessMode" title="Allow all clients"<%=(editBean.getAccessMode(curTunnel).equals("0") ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||||
</label>
|
<label><%=intl._("Whitelist")%></label>
|
||||||
<input value="1" type="checkbox" id="startOnLoad" name="access" title="Enable Access List"<%=(editBean.getAccess(curTunnel) ? " checked=\"checked\"" : "")%> class="tickbox" />
|
<input value="1" type="radio" id="startOnLoad" name="accessMode" title="Allow listed clients only"<%=(editBean.getAccessMode(curTunnel).equals("1") ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||||
|
<label><%=intl._("Blacklist")%></label>
|
||||||
|
<input value="2" type="radio" id="startOnLoad" name="accessMode" title="Reject listed clients"<%=(editBean.getAccessMode(curTunnel).equals("2") ? " checked=\"checked\"" : "")%> class="tickbox" />
|
||||||
</div>
|
</div>
|
||||||
<div id="hostField" class="rowItem">
|
<div id="hostField" class="rowItem">
|
||||||
<label for="accessList" accesskey="s">
|
<label for="accessList" accesskey="s">
|
||||||
<%=intl._("Access List")%>:
|
<%=intl._("Access List")%>:
|
||||||
</label>
|
</label>
|
||||||
<textarea rows="2" style="height: 6em;" cols="60" id="hostField" name="accessList" title="Access List" wrap="off"><%=editBean.getAccessList(curTunnel)%></textarea>
|
<textarea rows="2" style="height: 8em;" cols="60" id="hostField" name="accessList" title="Access List" wrap="off"><%=editBean.getAccessList(curTunnel)%></textarea>
|
||||||
<span class="comment"><%=intl._("(Restrict to these clients only)")%></span>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="subdivider">
|
<div class="subdivider">
|
||||||
|
Reference in New Issue
Block a user