|
|
@ -5,7 +5,7 @@
|
|
|
|
//(C) 2005, 2006 by Martin Thelian
|
|
|
|
//(C) 2005, 2006 by Martin Thelian
|
|
|
|
// Alexander Schier
|
|
|
|
// Alexander Schier
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//last change: $LastChangedDate$ by $LastChangedBy: $
|
|
|
|
//last change: $LastChangedDate$ by $LastChangedBy$
|
|
|
|
//Revision: $LastChangedRevision$
|
|
|
|
//Revision: $LastChangedRevision$
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//This program is free software; you can redistribute it and/or modify
|
|
|
|
//This program is free software; you can redistribute it and/or modify
|
|
|
@ -125,7 +125,7 @@ public final class userDB {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/**
|
|
|
|
* use a ProxyAuth String to authenticate a user
|
|
|
|
* use a ProxyAuth String to authenticate a user
|
|
|
|
* @param auth a base64 Encoded String, which contains "username:pw".
|
|
|
|
* @param auth a base64 Encoded String, which contains "username:pw".
|
|
|
|
*/
|
|
|
|
*/
|
|
|
@ -162,11 +162,9 @@ public final class userDB {
|
|
|
|
entry=proxyAuth(auth);
|
|
|
|
entry=proxyAuth(auth);
|
|
|
|
if(entry == null)
|
|
|
|
if(entry == null)
|
|
|
|
entry=cookieAuth(cookies);
|
|
|
|
entry=cookieAuth(cookies);
|
|
|
|
if(entry == null)
|
|
|
|
|
|
|
|
entry=cookieAuth(cookies);
|
|
|
|
|
|
|
|
return entry;
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
/**
|
|
|
|
* determinate, if a user has Adminrights from a authorisation http-headerfield
|
|
|
|
* determinate, if a user has Adminrights from a authorisation http-headerfield
|
|
|
|
* it tests both userDB and oldstyle adminpw.
|
|
|
|
* it tests both userDB and oldstyle adminpw.
|
|
|
|
* @param auth the http-headerline for authorisation
|
|
|
|
* @param auth the http-headerline for authorisation
|
|
|
@ -175,13 +173,13 @@ public final class userDB {
|
|
|
|
Entry entry=getUser(auth, ip, cookies);
|
|
|
|
Entry entry=getUser(auth, ip, cookies);
|
|
|
|
if(entry != null)
|
|
|
|
if(entry != null)
|
|
|
|
return entry.hasAdminRight();
|
|
|
|
return entry.hasAdminRight();
|
|
|
|
else if(cookieAdminAuth(cookies))
|
|
|
|
else if(entry != null && cookieAdminAuth(cookies))
|
|
|
|
return entry.hasAdminRight();
|
|
|
|
return entry.hasAdminRight();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/**
|
|
|
|
* use a ProxyAuth String to authenticate a user and save the ip/username for ipAuth
|
|
|
|
* use a ProxyAuth String to authenticate a user and save the ip/username for ipAuth
|
|
|
|
* @param auth a base64 Encoded String, which contains "username:pw".
|
|
|
|
* @param auth a base64 Encoded String, which contains "username:pw".
|
|
|
|
* @param ip an ip.
|
|
|
|
* @param ip an ip.
|
|
|
@ -195,7 +193,7 @@ public final class userDB {
|
|
|
|
this.ipUsers.put(ip, entry.getUserName());
|
|
|
|
this.ipUsers.put(ip, entry.getUserName());
|
|
|
|
return entry;
|
|
|
|
return entry;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
/**
|
|
|
|
* authenticate a user by ip, if he had used proxyAuth in the last 10 Minutes
|
|
|
|
* authenticate a user by ip, if he had used proxyAuth in the last 10 Minutes
|
|
|
|
* @param ip the IP of the User
|
|
|
|
* @param ip the IP of the User
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|