From 93c1cb9226b117ca67dbb93229c4a2bda130a903 Mon Sep 17 00:00:00 2001 From: allo Date: Fri, 14 Oct 2005 12:01:41 +0000 Subject: [PATCH] ipAuth works. thx theli. git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@939 6c8d7289-2bf4-0310-a012-ef5d649a1542 --- source/de/anomic/data/userDB.java | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/source/de/anomic/data/userDB.java b/source/de/anomic/data/userDB.java index 3b61f0a12..2b679b7c1 100644 --- a/source/de/anomic/data/userDB.java +++ b/source/de/anomic/data/userDB.java @@ -180,7 +180,6 @@ public final class userDB { return null; }else{ this.ipUsers.put(ip, entry.getUserName()); - System.out.println(ip+", "+entry.getUserName()); return entry; } } @@ -189,15 +188,11 @@ public final class userDB { * @param ip the IP of the User */ public Entry ipAuth(String ip) { - System.out.println(ip); if(this.ipUsers.containsKey(ip)){ String user=(String)this.ipUsers.get(ip); - System.out.println(user); Entry entry=this.getEntry(user); Long entryTimestamp=entry.getLastAccess(); if(entryTimestamp == null || (System.currentTimeMillis()-entryTimestamp.longValue()) > (1000*60*10) ){ //no timestamp or older than 10 Minutes - System.out.println("too old"); - System.out.println(System.currentTimeMillis()-entryTimestamp.longValue()); return null; } return entry; //All OK @@ -305,7 +300,8 @@ public final class userDB { } public boolean canSurf(){ - if( this.getTimeLimit() == null || this.getTimeLimit().longValue() <= 0 || (this.updateLastAccess(true) < this.getTimeLimit().longValue()) )//no timelimit or timelimit not reached + long timeUsed=this.updateLastAccess(true); + if( this.getTimeLimit() == null || this.getTimeLimit().longValue() <= 0 || ( timeUsed < this.getTimeLimit().longValue()) )//no timelimit or timelimit not reached return true; else return false;