passwordAuth

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1138 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent edaa820bec
commit b86d1085e2

@ -162,7 +162,7 @@ public final class userDB {
}catch(StringIndexOutOfBoundsException e){} //no valid Base64
String[] tmp=auth.split(":");
if(tmp.length == 2){
entry=this.getEntry(tmp[0]);
/*entry=this.getEntry(tmp[0]);
if( entry != null && entry.getMD5EncodedUserPwd().equals(serverCodings.encodeMD5Hex(auth)) ){
if(entry.isLoggedOut()){
try{
@ -171,13 +171,17 @@ public final class userDB {
return null;
}
return entry;
*/
entry=this.passwordAuth(tmp[0], tmp[1]);
if(entry != null){
//return entry;
}else{ //wrong/no auth, so auth is removed from browser
/*FIXME: This cannot work
try{
entry.setProperty(Entry.LOGGED_OUT, "false");
}catch(IOException e){}
*/
}catch(IOException e){}*/
}
return entry;
}
return null;
}
@ -212,6 +216,19 @@ public final class userDB {
return null;
}
}
public Entry passwordAuth(String user, String password){
Entry entry=this.getEntry(user);
if( entry != null && entry.getMD5EncodedUserPwd().equals(serverCodings.encodeMD5Hex(user+":"+password)) ){
if(entry.isLoggedOut()){
try{
entry.setProperty(Entry.LOGGED_OUT, "false");
}catch(IOException e){}
return null;
}
}
return entry;
}
public class Entry {
public static final String MD5ENCODED_USERPWD_STRING = "MD5_user:pwd";

Loading…
Cancel
Save