New modules/authentication-ip.cfg

git-svn-id: http://scm.dspace.org/svn/repo/dspace/trunk@6569 9c30dcfa-912a-0410-8fc2-9e0234be79fd
This commit is contained in:
Stuart Lewis
2011-08-19 04:21:03 +00:00
parent ebc67a4ae8
commit 7ebaabca4f
3 changed files with 31 additions and 4 deletions

View File

@@ -78,19 +78,18 @@ public class IPAuthentication implements AuthenticationMethod
ipMatcherGroupIDs = new HashMap<IPMatcher, Integer>(); ipMatcherGroupIDs = new HashMap<IPMatcher, Integer>();
ipMatcherGroupNames = new HashMap<IPMatcher, String>(); ipMatcherGroupNames = new HashMap<IPMatcher, String>();
Enumeration e = ConfigurationManager.propertyNames(); Enumeration e = ConfigurationManager.propertyNames("authentication-ip");
while (e.hasMoreElements()) while (e.hasMoreElements())
{ {
String propName = (String) e.nextElement(); String propName = (String) e.nextElement();
if (propName.startsWith("authentication.ip.")) if (propName.startsWith("ip."))
{ {
String[] nameParts = propName.split("\\."); String[] nameParts = propName.split("\\.");
if (nameParts.length == 3) if (nameParts.length == 3)
{ {
addMatchers(nameParts[2], ConfigurationManager addMatchers(nameParts[2], ConfigurationManager.getProperty("authentication-ip", propName));
.getProperty(propName));
} }
else else
{ {

View File

@@ -0,0 +1,14 @@
#### Example of configuring IP-based authentication
#### (to use, add org.dspace.authenticate.IPAuthentication to auth stack above)
#
# authentication.ip.GROUPNAME = iprange[, iprange ...]
#
# Note if the Groupname contains blanks you must escape it,
# e.g. Department\ of\ Statistics
#
# Full, partial IPs; network/netmask; network/CIDR
#
#ip.MY_UNIVERSITY = 10.1.2.3, \
# 13.5, \
# 11.3.4.5/24, \
# 12.7.8.9/255.255.128.0

View File

@@ -0,0 +1,14 @@
#### Example of configuring IP-based authentication
#### (to use, add org.dspace.authenticate.IPAuthentication to auth stack above)
#
# authentication.ip.GROUPNAME = iprange[, iprange ...]
#
# Note if the Groupname contains blanks you must escape it,
# e.g. Department\ of\ Statistics
#
# Full, partial IPs; network/netmask; network/CIDR
#
#ip.MY_UNIVERSITY = 10.1.2.3, \
# 13.5, \
# 11.3.4.5/24, \
# 12.7.8.9/255.255.128.0