Skip to content

Distributed Peer-to-Peer Web Search Engine and Intranet Search Appliance

logout function

allo4daa4b00e9fb
diff --git a/source/de/anomic/data/userDB.java b/source/de/anomic/data/userDB.java
index 4c26d3354..2385a4017 100644
--- a/source/de/anomic/data/userDB.java
+++ b/source/de/anomic/data/userDB.java
@@ -204,6 +204,7 @@ public final class userDB {
public class Entry {
public static final String MD5ENCODED_USERPWD_STRING = "MD5_user:pwd";
public static final String AUTHENTICATION_METHOD = "auth_method";
+ public static final String LOGGED_OUT = "loggedOut";
public static final String USER_FIRSTNAME = "firstName";
public static final String USER_LASTNAME = "lastName";
public static final String USER_ADDRESS = "address";
@@ -315,7 +316,7 @@ public final class userDB {
//TODO: more returnvalues.
//Exception if false, or CONSTANTS
long timeUsed=this.updateLastAccess(true);
- if(this.hasProxyRight() == false)
+ if(this.hasProxyRight() == false || this.isLoggedOut())
return false;
if( this.getTimeLimit() == null || this.getTimeLimit().longValue() <= 0 || ( timeUsed < this.getTimeLimit().longValue()) )//no timelimit or timelimit not reached
@@ -393,6 +394,14 @@ public final class userDB {
public boolean hasAdminRight() {
return (this.mem.containsKey(ADMIN_RIGHT)?((String)this.mem.get(ADMIN_RIGHT)).equals("true"):false);
}
+ public boolean isLoggedOut(){
+ return (this.mem.containsKey(LOGGED_OUT)?((String)this.mem.get(LOGGED_OUT)).equals("true"):false);
+ }
+ public void logout(){
+ try{
+ setProperty(LOGGED_OUT, "true");
+ }catch(IOException e){}
+ }
public String toString() {
StringBuffer str = new StringBuffer();