aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model/User.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-19 10:23:24 +1300
committerGitHub <noreply@github.com>2016-11-19 10:23:24 +1300
commitb0aa4698e95658f57ec2d3e0ed4f3fe0db8500a2 (patch)
tree3b8b691bb01298ba6207d18ce761bd9ee6537971 /src/org/traccar/model/User.java
parent3eca9acd6e6a160df8f7b86150429c3d7c09b0c3 (diff)
parente21cc32bb74d998246b52faaf49b6ea742e4d6e3 (diff)
downloadtrackermap-server-b0aa4698e95658f57ec2d3e0ed4f3fe0db8500a2.tar.gz
trackermap-server-b0aa4698e95658f57ec2d3e0ed4f3fe0db8500a2.tar.bz2
trackermap-server-b0aa4698e95658f57ec2d3e0ed4f3fe0db8500a2.zip
Merge pull request #2552 from Abyss777/token2
Implement users tokens
Diffstat (limited to 'src/org/traccar/model/User.java')
-rw-r--r--src/org/traccar/model/User.java15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java
index a36fa0e31..aa24b795e 100644
--- a/src/org/traccar/model/User.java
+++ b/src/org/traccar/model/User.java
@@ -180,6 +180,21 @@ public class User extends Extensible {
this.deviceLimit = deviceLimit;
}
+ private String token;
+
+ public String getToken() {
+ return token;
+ }
+
+ public void setToken(String token) {
+ if (token != null && !token.isEmpty()) {
+ if (!token.matches("^[a-zA-Z0-9]{16,}$")) {
+ throw new IllegalArgumentException("Illegal token");
+ }
+ this.token = token;
+ }
+ }
+
public String getPassword() {
return null;
}