diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-20 22:01:32 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-12-20 22:01:32 +1300 |
commit | 9bcc4c7f4871b2b028d2bc2a8680ba14b2607eb6 (patch) | |
tree | 083c6b9877ef28ae9a1547309cbdb23e984da8ac | |
parent | f04d420b323a324233c48d525254f1211afc0771 (diff) | |
download | trackermap-server-9bcc4c7f4871b2b028d2bc2a8680ba14b2607eb6.tar.gz trackermap-server-9bcc4c7f4871b2b028d2bc2a8680ba14b2607eb6.tar.bz2 trackermap-server-9bcc4c7f4871b2b028d2bc2a8680ba14b2607eb6.zip |
Fix some REST API minor issues
-rw-r--r-- | src/org/traccar/api/BaseResource.java | 10 | ||||
-rw-r--r-- | src/org/traccar/model/Command.java | 3 | ||||
-rw-r--r-- | web/locale.js | 5 |
3 files changed, 10 insertions, 8 deletions
diff --git a/src/org/traccar/api/BaseResource.java b/src/org/traccar/api/BaseResource.java index 368df7166..aa1101f02 100644 --- a/src/org/traccar/api/BaseResource.java +++ b/src/org/traccar/api/BaseResource.java @@ -22,12 +22,12 @@ public class BaseResource { @javax.ws.rs.core.Context private SecurityContext securityContext; - protected SecurityContext getSecurityContext() { - return securityContext; - } - protected long getUserId() { - return ((UserPrincipal) securityContext.getUserPrincipal()).getUserId(); + UserPrincipal principal = (UserPrincipal) securityContext.getUserPrincipal(); + if (principal != null) { + return principal.getUserId(); + } + return 0; } } diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java index df62164c2..bc99967b6 100644 --- a/src/org/traccar/model/Command.java +++ b/src/org/traccar/model/Command.java @@ -15,6 +15,9 @@ */ package org.traccar.model; +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; + +@JsonIgnoreProperties(ignoreUnknown=true) public class Command extends Extensible { public static final String TYPE_POSITION_SINGLE = "positionSingle"; diff --git a/web/locale.js b/web/locale.js index a4bc9918d..67f0942ba 100644 --- a/web/locale.js +++ b/web/locale.js @@ -16,9 +16,8 @@ var Locale = {}; -Ext.Loader.setConfig({ - disableCaching: false -}); +Ext.Ajax.disableCaching = false; +Ext.Loader.disableCaching = false; Locale.languages = { 'ar': { name: 'العربية', code: 'en' }, |