|
|
|
@ -49,7 +49,7 @@ public class YaCyLoginService extends MappedLoginService {
|
|
|
|
|
|
|
|
|
|
// TODO: implement legacy credentials
|
|
|
|
|
final Switchboard sb = Switchboard.getSwitchboard();
|
|
|
|
|
String adminuser = sb.getConfig("adminAccount", "admin");
|
|
|
|
|
String adminuser = sb.getConfig("adminAccountUserName", "admin");
|
|
|
|
|
if (username.equals(adminuser)) {
|
|
|
|
|
final String adminAccountBase64MD5 = sb.getConfig(SwitchboardConstants.ADMIN_ACCOUNT_B64MD5, "");
|
|
|
|
|
// in YaCy the credential hash is composed of username:pwd so the username is needed to create valid credential
|
|
|
|
@ -69,9 +69,8 @@ public class YaCyLoginService extends MappedLoginService {
|
|
|
|
|
} else { // get user data from UserDB
|
|
|
|
|
Entry user = sb.userDB.getEntry(username);
|
|
|
|
|
if (user != null) {
|
|
|
|
|
String[] role;
|
|
|
|
|
if (user.hasRight(AccessRight.ADMIN_RIGHT)) {
|
|
|
|
|
role = new String[]{AccessRight.ADMIN_RIGHT.toString()};
|
|
|
|
|
String[] role = new String[]{AccessRight.ADMIN_RIGHT.toString()};
|
|
|
|
|
|
|
|
|
|
Credential credential = YaCyLegacyCredential.getCredentials(username, user.getMD5EncodedUserPwd());
|
|
|
|
|
Principal userPrincipal = new MappedLoginService.KnownUser(username, credential);
|
|
|
|
|