aboutsummaryrefslogtreecommitdiff
path: root/web/app/view/UserDialogController.js
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-11-18 16:06:02 +0500
committerAbyss777 <abyss@fox5.ru>2016-11-18 16:06:02 +0500
commitc6d8d7646a06e2624a0dac48b93fd5b1dd0db146 (patch)
treecd248c84222c7d22f133b27b6e4769cadca01857 /web/app/view/UserDialogController.js
parenta252dbe43512c75afd4a17075b834f767576fd28 (diff)
downloadtrackermap-web-c6d8d7646a06e2624a0dac48b93fd5b1dd0db146.tar.gz
trackermap-web-c6d8d7646a06e2624a0dac48b93fd5b1dd0db146.tar.bz2
trackermap-web-c6d8d7646a06e2624a0dac48b93fd5b1dd0db146.zip
Implement users tokens
Diffstat (limited to 'web/app/view/UserDialogController.js')
-rw-r--r--web/app/view/UserDialogController.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/web/app/view/UserDialogController.js b/web/app/view/UserDialogController.js
index cd0a9512..e2e822e7 100644
--- a/web/app/view/UserDialogController.js
+++ b/web/app/view/UserDialogController.js
@@ -26,9 +26,23 @@ Ext.define('Traccar.view.UserDialogController', {
this.lookupReference('disabledField').setHidden(false);
this.lookupReference('expirationTimeField').setDisabled(false);
this.lookupReference('deviceLimitField').setDisabled(false);
+ this.lookupReference('tokenField').setDisabled(false);
}
},
+ symbols: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789',
+
+ generateToken: function () {
+ var newToken, i;
+ newToken = '';
+
+ for (i = 0; i < 16; i++) {
+ newToken += this.symbols.charAt(Math.floor(Math.random() * this.symbols.length));
+ }
+
+ this.lookupReference('tokenField').setValue(newToken);
+ },
+
onSaveClick: function (button) {
var dialog, record, store;
dialog = button.up('window').down('form');