aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/database/DataManager.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/database/DataManager.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/database/DataManager.java')
-rw-r--r--src/org/traccar/database/DataManager.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/database/DataManager.java b/src/org/traccar/database/DataManager.java
index f68ff2ae6..4c12ecd77 100644
--- a/src/org/traccar/database/DataManager.java
+++ b/src/org/traccar/database/DataManager.java
@@ -34,14 +34,14 @@ import javax.sql.DataSource;
import org.traccar.Config;
import org.traccar.helper.DriverDelegate;
import org.traccar.helper.Log;
-import org.traccar.web.AsyncServlet;
-import org.traccar.web.JsonConverter;
import org.traccar.model.Device;
import org.traccar.model.MiscFormatter;
import org.traccar.model.Permission;
import org.traccar.model.Position;
import org.traccar.model.Server;
import org.traccar.model.User;
+import org.traccar.web.AsyncServlet;
+import org.traccar.web.JsonConverter;
public class DataManager implements IdentityManager {
@@ -227,6 +227,12 @@ public class DataManager implements IdentityManager {
.executeQuery(new User());
}
+ public User getUser(long userId) throws SQLException {
+ return QueryBuilder.create(dataSource, getQuery("database.selectUser"))
+ .setLong("id", userId)
+ .executeQuerySingle(new User());
+ }
+
public void addUser(User user) throws SQLException {
user.setId(QueryBuilder.create(dataSource, getQuery("database.insertUser"), true)
.setObject(user)