code simplifications / removed warnings

pull/1/head
Michael Peter Christen 11 years ago
parent 0168f80c28
commit 489c3fbc90

@ -91,12 +91,11 @@ public class Jetty8YaCySecurityHandler extends ConstraintSecurityHandler {
if (protectedPage) {
if (grantedForLocalhost) {
return null; // quick return for local admin
} else {
RoleInfo roleinfo = new RoleInfo();
roleinfo.setChecked(true); // RoleInfo.setChecked() : in Jetty this means - marked to have any security constraint
roleinfo.addRole(AccessRight.ADMIN_RIGHT.toString()); // use AccessRights as role
return roleinfo;
}
}
RoleInfo roleinfo = new RoleInfo();
roleinfo.setChecked(true); // RoleInfo.setChecked() : in Jetty this means - marked to have any security constraint
roleinfo.addRole(AccessRight.ADMIN_RIGHT.toString()); // use AccessRights as role
return roleinfo;
}
return (RoleInfo)super.prepareConstraintInfo(pathInContext, request);
}

@ -86,9 +86,8 @@ public class YaCyLegacyCredential extends Credential {
// normal users (and new admin pwd)
if (hash.startsWith(MD5.__TYPE) && hash != null) {
return (Digest.encodeMD5Hex(foruser + ":" + Switchboard.getSwitchboard().getConfig(SwitchboardConstants.ADMIN_REALM,"YaCy")+":" + pw).equals(hash.substring(4)));
} else { // special check for old style password hash (prior v1.67/9501 15.1.2014)
return Digest.encodeMD5Hex(foruser + ":" + pw).equals(hash);
}
return Digest.encodeMD5Hex(foruser + ":" + pw).equals(hash);
}
throw new UnsupportedOperationException();
}

@ -76,9 +76,8 @@ public class YaCyLoginService extends MappedLoginService implements LoginService
if (credential != null) {
if (roles != null) {
return putUser(username, credential, roles);
} else {
return putUser(username, credential); // w/o role makes not much sense, but succeeds login....
}
return putUser(username, credential); // w/o role makes not much sense, but succeeds login....
}
return null;
}

@ -126,7 +126,6 @@ import net.yacy.crawler.HarvestProcess;
import net.yacy.crawler.data.Cache;
import net.yacy.crawler.data.CrawlProfile;
import net.yacy.crawler.data.CrawlQueues;
import net.yacy.crawler.data.Latency;
import net.yacy.crawler.data.NoticedURL;
import net.yacy.crawler.data.ResultImages;
import net.yacy.crawler.data.ResultURLs;

Loading…
Cancel
Save