char roleGroupSeperator, AbstractServerLoginModule aslm)
{
Logger log = aslm.log;
boolean trace = log.isTraceEnabled();
Enumeration users = roles.propertyNames();
SimpleGroup rolesGroup = new SimpleGroup("Roles");
ArrayList groups = new ArrayList();
groups.add(rolesGroup);
while (users.hasMoreElements() && targetUser != null)
{
String user = (String) users.nextElement();
String value = roles.getProperty(user);
if( trace )
log.trace("Checking user: "+user+", roles string: "+value);
// See if this entry is of the form targetUser[.GroupName]=roles
//JBAS-3742 - skip potential '.' in targetUser
int index = user.indexOf(roleGroupSeperator, targetUser.length());
boolean isRoleGroup = false;
boolean userMatch = false;
if (index > 0 && targetUser.regionMatches(0, user, 0, index) == true)
isRoleGroup = true;
else
userMatch = targetUser.equals(user);
// Check for username.RoleGroup pattern
if (isRoleGroup == true)
{
String groupName = user.substring(index + 1);
if (groupName.equals("Roles"))
{
if( trace )
log.trace("Adding to Roles: "+value);
parseGroupMembers(rolesGroup, value, aslm);
}
else
{
if( trace )
log.trace("Adding to "+groupName+": "+value);
SimpleGroup group = new SimpleGroup(groupName);
parseGroupMembers(group, value, aslm);
groups.add(group);
}
}
else if (userMatch == true)