Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel/User.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/beta/js/Clipperz/PM/DataModel/User.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/User.js b/frontend/beta/js/Clipperz/PM/DataModel/User.js index 5aaaff7..dbbe9a0 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/User.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/User.js | |||
@@ -1,120 +1,117 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2011 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz's Javascript Crypto Library. | 5 | This file is part of Clipperz Community Edition. |
6 | Javascript Crypto Library provides web developers with an extensive | 6 | Clipperz Community Edition is an online password manager. |
7 | and efficient set of cryptographic functions. The library aims to | ||
8 | obtain maximum execution speed while preserving modularity and | ||
9 | reusability. | ||
10 | For further information about its features and functionalities please | 7 | For further information about its features and functionalities please |
11 | refer to http://www.clipperz.com | 8 | refer to http://www.clipperz.com. |
12 | 9 | ||
13 | * Javascript Crypto Library is free software: you can redistribute | 10 | * Clipperz Community Edition is free software: you can redistribute |
14 | it and/or modify it under the terms of the GNU Affero General Public | 11 | it and/or modify it under the terms of the GNU Affero General Public |
15 | License as published by the Free Software Foundation, either version | 12 | License as published by the Free Software Foundation, either version |
16 | 3 of the License, or (at your option) any later version. | 13 | 3 of the License, or (at your option) any later version. |
17 | 14 | ||
18 | * Javascript Crypto Library is distributed in the hope that it will | 15 | * Clipperz Community Edition is distributed in the hope that it will |
19 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 16 | be useful, but WITHOUT ANY WARRANTY; without even the implied |
20 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
21 | See the GNU Affero General Public License for more details. | 18 | See the GNU Affero General Public License for more details. |
22 | 19 | ||
23 | * You should have received a copy of the GNU Affero General Public | 20 | * You should have received a copy of the GNU Affero General Public |
24 | License along with Javascript Crypto Library. If not, see | 21 | License along with Clipperz Community Edition. If not, see |
25 | <http://www.gnu.org/licenses/>. | 22 | <http://www.gnu.org/licenses/>. |
26 | 23 | ||
27 | */ | 24 | */ |
28 | 25 | ||
29 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
30 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
31 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
32 | 29 | ||
33 | 30 | ||
34 | //############################################################################# | 31 | //############################################################################# |
35 | 32 | ||
36 | Clipperz.PM.DataModel.User = function(args) { | 33 | Clipperz.PM.DataModel.User = function(args) { |
37 | //MochiKit.Logging.logDebug(">>> new User"); | 34 | //MochiKit.Logging.logDebug(">>> new User"); |
38 | args = args || {}; | 35 | args = args || {}; |
39 | 36 | ||
40 | this._username = args.username || null; | 37 | this._username = args.username || null; |
41 | this._passphrase = args.passphrase || null; | 38 | this._passphrase = args.passphrase || null; |
42 | 39 | ||
43 | this._connection = null; | 40 | this._connection = null; |
44 | this._connectionVersion = 'current'; | 41 | this._connectionVersion = 'current'; |
45 | 42 | ||
46 | this._header = null; | 43 | this._header = null; |
47 | this._statistics = null; | 44 | this._statistics = null; |
48 | this._lock = 'new lock'; | 45 | this._lock = 'new lock'; |
49 | 46 | ||
50 | this._preferences = null; | 47 | this._preferences = null; |
51 | this._records = {}; | 48 | this._records = {}; |
52 | this._directLoginReferences = {}; | 49 | this._directLoginReferences = {}; |
53 | this._oneTimePasswordManager = null; | 50 | this._oneTimePasswordManager = null; |
54 | 51 | ||
55 | this._isLoadingUserDetails = false; | 52 | this._isLoadingUserDetails = false; |
56 | this._loadingUserDetailsPendingQueue = []; | 53 | this._loadingUserDetailsPendingQueue = []; |
57 | 54 | ||
58 | this._maxNumberOfRecords = Number.MAX_VALUE; | 55 | this._maxNumberOfRecords = Number.MAX_VALUE; |
59 | 56 | ||
60 | this._shouldDownloadOfflineCopy = false; | 57 | this._shouldDownloadOfflineCopy = false; |
61 | 58 | ||
62 | this._loginInfo = null; | 59 | this._loginInfo = null; |
63 | this._loginHistory = null; | 60 | this._loginHistory = null; |
64 | 61 | ||
65 | this._serverData = null; | 62 | this._serverData = null; |
66 | //MochiKit.Logging.logDebug("<<< new User"); | 63 | //MochiKit.Logging.logDebug("<<< new User"); |
67 | 64 | ||
68 | return this; | 65 | return this; |
69 | } | 66 | } |
70 | 67 | ||
71 | Clipperz.PM.DataModel.User.prototype = MochiKit.Base.update(null, { | 68 | Clipperz.PM.DataModel.User.prototype = MochiKit.Base.update(null, { |
72 | 69 | ||
73 | 'toString': function() { | 70 | 'toString': function() { |
74 | return "Clipperz.PM.DataModel.User - " + this.username(); | 71 | return "Clipperz.PM.DataModel.User - " + this.username(); |
75 | }, | 72 | }, |
76 | 73 | ||
77 | //------------------------------------------------------------------------- | 74 | //------------------------------------------------------------------------- |
78 | 75 | ||
79 | 'username': function() { | 76 | 'username': function() { |
80 | return this._username; | 77 | return this._username; |
81 | }, | 78 | }, |
82 | 79 | ||
83 | 'setUsername': function(aValue) { | 80 | 'setUsername': function(aValue) { |
84 | this._username = aValue; | 81 | this._username = aValue; |
85 | }, | 82 | }, |
86 | 83 | ||
87 | //------------------------------------------------------------------------- | 84 | //------------------------------------------------------------------------- |
88 | 85 | ||
89 | 'passphrase': function() { | 86 | 'passphrase': function() { |
90 | return this._passphrase; | 87 | return this._passphrase; |
91 | }, | 88 | }, |
92 | 89 | ||
93 | 'setPassphrase': function(aValue) { | 90 | 'setPassphrase': function(aValue) { |
94 | this._passphrase = aValue; | 91 | this._passphrase = aValue; |
95 | }, | 92 | }, |
96 | 93 | ||
97 | //------------------------------------------------------------------------- | 94 | //------------------------------------------------------------------------- |
98 | 95 | ||
99 | 'maxNumberOfRecords': function() { | 96 | 'maxNumberOfRecords': function() { |
100 | return this._maxNumberOfRecords; | 97 | return this._maxNumberOfRecords; |
101 | }, | 98 | }, |
102 | 99 | ||
103 | 'setMaxNumberOfRecords': function(aValue) { | 100 | 'setMaxNumberOfRecords': function(aValue) { |
104 | this._maxNumberOfRecords = aValue; | 101 | this._maxNumberOfRecords = aValue; |
105 | }, | 102 | }, |
106 | 103 | ||
107 | //------------------------------------------------------------------------- | 104 | //------------------------------------------------------------------------- |
108 | 105 | ||
109 | 'errorHandler': function(anErrorString, anException) { | 106 | 'errorHandler': function(anErrorString, anException) { |
110 | MochiKit.Logging.logError("- User.errorHandler: " + anErrorString + " (" + anException + ")"); | 107 | MochiKit.Logging.logError("- User.errorHandler: " + anErrorString + " (" + anException + ")"); |
111 | }, | 108 | }, |
112 | 109 | ||
113 | //------------------------------------------------------------------------- | 110 | //------------------------------------------------------------------------- |
114 | 111 | ||
115 | 'connectionVersion': function() { | 112 | 'connectionVersion': function() { |
116 | return this._connectionVersion; | 113 | return this._connectionVersion; |
117 | }, | 114 | }, |
118 | 115 | ||
119 | 'setConnectionVersion': function(aValue) { | 116 | 'setConnectionVersion': function(aValue) { |
120 | this._connectionVersion = aValue; | 117 | this._connectionVersion = aValue; |