aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/web/BaseServlet.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 19:53:11 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-25 19:53:11 +1200
commitdeb288877b8faa69c763c96ada7529380141af7f (patch)
tree6ae4210935ca851382d14a2388468811438677c5 /src/org/traccar/web/BaseServlet.java
parente637bd7c022560dcc9c48516dc22a884a5de8122 (diff)
downloadtrackermap-server-deb288877b8faa69c763c96ada7529380141af7f.tar.gz
trackermap-server-deb288877b8faa69c763c96ada7529380141af7f.tar.bz2
trackermap-server-deb288877b8faa69c763c96ada7529380141af7f.zip
Update sessions user info
Diffstat (limited to 'src/org/traccar/web/BaseServlet.java')
-rw-r--r--src/org/traccar/web/BaseServlet.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/org/traccar/web/BaseServlet.java b/src/org/traccar/web/BaseServlet.java
index 28b4b467e..b7df841ca 100644
--- a/src/org/traccar/web/BaseServlet.java
+++ b/src/org/traccar/web/BaseServlet.java
@@ -25,7 +25,6 @@ import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import org.traccar.model.User;
public abstract class BaseServlet extends HttpServlet {
@@ -51,11 +50,11 @@ public abstract class BaseServlet extends HttpServlet {
protected abstract boolean handle(String command, HttpServletRequest req, HttpServletResponse resp) throws Exception;
public long getUserId(HttpServletRequest req) {
- User user = (User) req.getSession().getAttribute(USER_KEY);
- if (user == null) {
+ Long userId = (Long) req.getSession().getAttribute(USER_KEY);
+ if (userId == null) {
throw new AccessControlException("User not logged in");
}
- return user.getId();
+ return userId;
}
public void securityCheck(boolean check) throws SecurityException {