Diffstat (limited to 'frontend/beta/js/Clipperz/PM/DataModel') (more/less context) (ignore whitespace changes)
13 files changed, 130 insertions, 156 deletions
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js index aee5703..c0cfa3c 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLogin.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.DirectLogin = function(args) { | 31 | Clipperz.PM.DataModel.DirectLogin = function(args) { |
34 | //MochiKit.Logging.logDebug(">>> new Clipperz.PM.DataModel.DirectLogin"); | 32 | //MochiKit.Logging.logDebug(">>> new Clipperz.PM.DataModel.DirectLogin"); |
35 | //console.log(">>> new Clipperz.PM.DataModel.DirectLogin - args: %o", args); | 33 | //console.log(">>> new Clipperz.PM.DataModel.DirectLogin - args: %o", args); |
36 | //console.log("--- formData: %s", Clipperz.Base.serializeJSON(args.formData)); | 34 | //console.log("--- formData: %s", Clipperz.Base.serializeJSON(args.formData)); |
37 | args = args || {}; | 35 | args = args || {}; |
38 | 36 | ||
39 | //MochiKit.Logging.logDebug("--- new Clipperz.PM.DataModel.DirectLogin - args: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args))); | 37 | //MochiKit.Logging.logDebug("--- new Clipperz.PM.DataModel.DirectLogin - args: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args))); |
40 | this._record = args.record || null; | 38 | this._record = args.record || null; |
41 | this._label = args.label || "unnamed record" | 39 | this._label = args.label || "unnamed record" |
42 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); | 40 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); |
43 | this._favicon = args.favicon || null; | 41 | this._favicon = args.favicon || null; |
44 | this._bookmarkletVersion = args.bookmarkletVersion || "0.1"; | 42 | this._bookmarkletVersion = args.bookmarkletVersion || "0.1"; |
45 | 43 | ||
46 | this._directLoginInputs = null; | 44 | this._directLoginInputs = null; |
47 | 45 | ||
48 | this._formValues = args.formValues || {}; | 46 | this._formValues = args.formValues || {}; |
49 | this.setFormData(args.formData || null); | 47 | this.setFormData(args.formData || null); |
50 | //console.log("=== formData: %o", this.formData()); | 48 | //console.log("=== formData: %o", this.formData()); |
51 | 49 | ||
52 | if (args.legacyBindingData == null) { | 50 | if (args.legacyBindingData == null) { |
53 | this.setBindingData(args.bindingData || null); | 51 | this.setBindingData(args.bindingData || null); |
54 | } else { | 52 | } else { |
55 | this.setLegacyBindingData(args.legacyBindingData); | 53 | this.setLegacyBindingData(args.legacyBindingData); |
56 | } | 54 | } |
57 | 55 | ||
58 | this._fixedFavicon = null; | 56 | this._fixedFavicon = null; |
59 | 57 | ||
60 | //this._formValues = args.formValues || (this.hasValuesToSet() ? {} : null); | 58 | //this._formValues = args.formValues || (this.hasValuesToSet() ? {} : null); |
61 | //MochiKit.Logging.logDebug("<<< new Clipperz.PM.DataModel.DirectLogin"); | 59 | //MochiKit.Logging.logDebug("<<< new Clipperz.PM.DataModel.DirectLogin"); |
62 | 60 | ||
63 | return this; | 61 | return this; |
64 | } | 62 | } |
65 | 63 | ||
66 | Clipperz.PM.DataModel.DirectLogin.prototype = MochiKit.Base.update(null, { | 64 | Clipperz.PM.DataModel.DirectLogin.prototype = MochiKit.Base.update(null, { |
67 | 65 | ||
68 | 'remove': function() { | 66 | 'remove': function() { |
69 | this.record().removeDirectLogin(this); | 67 | this.record().removeDirectLogin(this); |
70 | }, | 68 | }, |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js index 7f09bff..cef41af 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginBinding.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, aKey, args) { | 31 | Clipperz.PM.DataModel.DirectLoginBinding = function(aDirectLogin, aKey, args) { |
34 | //MochiKit.Logging.logDebug(">>> new DirectLoginBinding") | 32 | //MochiKit.Logging.logDebug(">>> new DirectLoginBinding") |
35 | args = args || {}; | 33 | args = args || {}; |
36 | //MochiKit.Logging.logDebug("--- new DirectLoginBinding - args: " + Clipperz.Base.serializeJSON(args)); | 34 | //MochiKit.Logging.logDebug("--- new DirectLoginBinding - args: " + Clipperz.Base.serializeJSON(args)); |
37 | 35 | ||
38 | this._directLogin = aDirectLogin || args.directLogin || null; | 36 | this._directLogin = aDirectLogin || args.directLogin || null; |
39 | this._key = aKey; | 37 | this._key = aKey; |
40 | 38 | ||
41 | this._fieldKey = args.fieldKey || null; | 39 | this._fieldKey = args.fieldKey || null; |
42 | this._fieldName = args.fieldName || null; | 40 | this._fieldName = args.fieldName || null; |
43 | //MochiKit.Logging.logDebug("<<< new DirectLoginBinding") | 41 | //MochiKit.Logging.logDebug("<<< new DirectLoginBinding") |
44 | 42 | ||
45 | return this; | 43 | return this; |
46 | } | 44 | } |
47 | 45 | ||
48 | Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, { | 46 | Clipperz.PM.DataModel.DirectLoginBinding.prototype = MochiKit.Base.update(null, { |
49 | 47 | ||
50 | 'directLogin': function() { | 48 | 'directLogin': function() { |
51 | return this._directLogin; | 49 | return this._directLogin; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
55 | 53 | ||
56 | 'key': function() { | 54 | 'key': function() { |
57 | return this._key; | 55 | return this._key; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'fieldKey': function() { | 60 | 'fieldKey': function() { |
63 | //MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey"); | 61 | //MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey"); |
64 | //MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey - " + this._fieldKey); | 62 | //MochiKit.Logging.logDebug("=== Clipperz.PM.DataModel.DirectLoginBinding.fieldKey - " + this._fieldKey); |
65 | return this._fieldKey; | 63 | return this._fieldKey; |
66 | }, | 64 | }, |
67 | 65 | ||
68 | 'setFieldKey': function(aValue) { | 66 | 'setFieldKey': function(aValue) { |
69 | this._fieldKey = aValue; | 67 | this._fieldKey = aValue; |
70 | }, | 68 | }, |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js index 0e2b7ad..e5e9ad5 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginInput.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | //############################################################################# | 28 | //############################################################################# |
31 | 29 | ||
32 | Clipperz.PM.DataModel.DirectLoginInput = function(aDirectLogin, args) { | 30 | Clipperz.PM.DataModel.DirectLoginInput = function(aDirectLogin, args) { |
33 | args = args || {}; | 31 | args = args || {}; |
34 | 32 | ||
35 | //console.log(">>> new DirectLoginInput - args: %o" + args); | 33 | //console.log(">>> new DirectLoginInput - args: %o" + args); |
36 | this._directLogin = aDirectLogin; | 34 | this._directLogin = aDirectLogin; |
37 | this._args = args; | 35 | this._args = args; |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { | 40 | Clipperz.PM.DataModel.DirectLoginInput.prototype = MochiKit.Base.update(null, { |
43 | 41 | ||
44 | 'directLogin': function() { | 42 | 'directLogin': function() { |
45 | return this._directLogin; | 43 | return this._directLogin; |
46 | }, | 44 | }, |
47 | 45 | ||
48 | //------------------------------------------------------------------------- | 46 | //------------------------------------------------------------------------- |
49 | 47 | ||
50 | 'args': function() { | 48 | 'args': function() { |
51 | return this._args; | 49 | return this._args; |
52 | }, | 50 | }, |
53 | 51 | ||
54 | //------------------------------------------------------------------------- | 52 | //------------------------------------------------------------------------- |
55 | 53 | ||
56 | 'name': function() { | 54 | 'name': function() { |
57 | return this.args()['name']; | 55 | return this.args()['name']; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'type': function() { | 60 | 'type': function() { |
63 | var result; | 61 | var result; |
64 | 62 | ||
65 | result = this.args()['type']; | 63 | result = this.args()['type']; |
66 | 64 | ||
67 | if (result != null) { | 65 | if (result != null) { |
68 | result = result.toLowerCase(); | 66 | result = result.toLowerCase(); |
69 | } | 67 | } |
70 | return result; | 68 | return result; |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js index 2be7d58..236d7c9 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/DirectLoginReference.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.DirectLoginReference = function(args) { | 31 | Clipperz.PM.DataModel.DirectLoginReference = function(args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | //MochiKit.Logging.logDebug(">>> new DirectLoginReference: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args))); | 34 | //MochiKit.Logging.logDebug(">>> new DirectLoginReference: " + Clipperz.Base.serializeJSON(MochiKit.Base.keys(args))); |
37 | //MochiKit.Logging.logDebug(">>> new DirectLoginReference - record: " + args.record); | 35 | //MochiKit.Logging.logDebug(">>> new DirectLoginReference - record: " + args.record); |
38 | this._user = args.user; | 36 | this._user = args.user; |
39 | 37 | ||
40 | if (args.directLogin != null) { | 38 | if (args.directLogin != null) { |
41 | this._reference = args.directLogin.reference(); | 39 | this._reference = args.directLogin.reference(); |
42 | this._recordReference = args.directLogin.record().reference(); | 40 | this._recordReference = args.directLogin.record().reference(); |
43 | this._label = args.directLogin.label(); | 41 | this._label = args.directLogin.label(); |
44 | this._favicon = args.directLogin.favicon() || null; | 42 | this._favicon = args.directLogin.favicon() || null; |
45 | 43 | ||
46 | this._directLogin = args.directLogin; | 44 | this._directLogin = args.directLogin; |
47 | this._record = args.directLogin.record(); | 45 | this._record = args.directLogin.record(); |
48 | } else { | 46 | } else { |
49 | this._reference = args.reference; | 47 | this._reference = args.reference; |
50 | this._recordReference = args.record; | 48 | this._recordReference = args.record; |
51 | this._label = args.label; | 49 | this._label = args.label; |
52 | this._favicon = args.favicon || null; | 50 | this._favicon = args.favicon || null; |
53 | 51 | ||
54 | this._directLogin = null; | 52 | this._directLogin = null; |
55 | this._record = null; | 53 | this._record = null; |
56 | } | 54 | } |
57 | 55 | ||
58 | this._fixedFavicon = null; | 56 | this._fixedFavicon = null; |
59 | 57 | ||
60 | return this; | 58 | return this; |
61 | } | 59 | } |
62 | 60 | ||
63 | Clipperz.PM.DataModel.DirectLoginReference.prototype = MochiKit.Base.update(null, { | 61 | Clipperz.PM.DataModel.DirectLoginReference.prototype = MochiKit.Base.update(null, { |
64 | 62 | ||
65 | 'user': function() { | 63 | 'user': function() { |
66 | return this._user; | 64 | return this._user; |
67 | }, | 65 | }, |
68 | 66 | ||
69 | //------------------------------------------------------------------------- | 67 | //------------------------------------------------------------------------- |
70 | 68 | ||
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Header.js b/frontend/beta/js/Clipperz/PM/DataModel/Header.js index c780855..908d9f4 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/Header.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/Header.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.Header = function(args) { | 31 | Clipperz.PM.DataModel.Header = function(args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._user = args.user; | 34 | this._user = args.user; |
37 | 35 | ||
38 | this._serverData = null; | 36 | this._serverData = null; |
39 | this._serverDataVersion = null; | 37 | this._serverDataVersion = null; |
40 | this._jsonEvaledServerData = null; | 38 | this._jsonEvaledServerData = null; |
41 | 39 | ||
42 | this._decryptedLegacyServerData = null; | 40 | this._decryptedLegacyServerData = null; |
43 | this._isDecryptingLegacyServerData = false; | 41 | this._isDecryptingLegacyServerData = false; |
44 | this._decryptingLegacyServerDataPendingQueue = []; | 42 | this._decryptingLegacyServerDataPendingQueue = []; |
45 | 43 | ||
46 | this.resetUpdatedSections(); | 44 | this.resetUpdatedSections(); |
47 | 45 | ||
48 | this._shouldLoadSections = {}; | 46 | this._shouldLoadSections = {}; |
49 | 47 | ||
50 | Clipperz.NotificationCenter.register(this.user(), 'updatedSection', this, 'updatedSectionHandler'); | 48 | Clipperz.NotificationCenter.register(this.user(), 'updatedSection', this, 'updatedSectionHandler'); |
51 | 49 | ||
52 | return this; | 50 | return this; |
53 | } | 51 | } |
54 | 52 | ||
55 | Clipperz.PM.DataModel.Header.prototype = MochiKit.Base.update(null, { | 53 | Clipperz.PM.DataModel.Header.prototype = MochiKit.Base.update(null, { |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'user': function() { | 57 | 'user': function() { |
60 | return this._user; | 58 | return this._user; |
61 | }, | 59 | }, |
62 | 60 | ||
63 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
64 | //------------------------------------------------------------------------- | 62 | //------------------------------------------------------------------------- |
65 | //------------------------------------------------------------------------- | 63 | //------------------------------------------------------------------------- |
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | //------------------------------------------------------------------------- | 65 | //------------------------------------------------------------------------- |
68 | //------------------------------------------------------------------------- | 66 | //------------------------------------------------------------------------- |
69 | //------------------------------------------------------------------------- | 67 | //------------------------------------------------------------------------- |
70 | //------------------------------------------------------------------------- | 68 | //------------------------------------------------------------------------- |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js index 88f383a..3f611b4 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePassword.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.OneTimePassword = function(args) { | 31 | Clipperz.PM.DataModel.OneTimePassword = function(args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | //console.log("new OneTimePassword", args); | 34 | //console.log("new OneTimePassword", args); |
37 | //MochiKit.Logging.logDebug("---"); | 35 | //MochiKit.Logging.logDebug("---"); |
38 | this._user = args['user']; | 36 | this._user = args['user']; |
39 | this._password = args['password']; | 37 | this._password = args['password']; |
40 | this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']); | 38 | this._passwordValue = Clipperz.PM.DataModel.OneTimePassword.normalizedOneTimePassword(args['password']); |
41 | this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); | 39 | this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); |
42 | this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date(); | 40 | this._creationDate = args['created'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['created']) : new Date(); |
43 | this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null; | 41 | this._usageDate = args['used'] ? Clipperz.PM.Date.parseDateWithUTCFormat(args['used']) : null; |
44 | 42 | ||
45 | this._status = args['status'] || 'ACTIVE'; | 43 | this._status = args['status'] || 'ACTIVE'; |
46 | this._connectionInfo = null; | 44 | this._connectionInfo = null; |
47 | 45 | ||
48 | this._key = null; | 46 | this._key = null; |
49 | this._keyChecksum = null; | 47 | this._keyChecksum = null; |
50 | 48 | ||
51 | return this; | 49 | return this; |
52 | } | 50 | } |
53 | 51 | ||
54 | Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, { | 52 | Clipperz.PM.DataModel.OneTimePassword.prototype = MochiKit.Base.update(null, { |
55 | 53 | ||
56 | 'toString': function() { | 54 | 'toString': function() { |
57 | return "Clipperz.PM.DataModel.OneTimePassword"; | 55 | return "Clipperz.PM.DataModel.OneTimePassword"; |
58 | }, | 56 | }, |
59 | 57 | ||
60 | //------------------------------------------------------------------------- | 58 | //------------------------------------------------------------------------- |
61 | 59 | ||
62 | 'user': function() { | 60 | 'user': function() { |
63 | return this._user; | 61 | return this._user; |
64 | }, | 62 | }, |
65 | 63 | ||
66 | //------------------------------------------------------------------------- | 64 | //------------------------------------------------------------------------- |
67 | 65 | ||
68 | 'password': function() { | 66 | 'password': function() { |
69 | return this._password; | 67 | return this._password; |
70 | }, | 68 | }, |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js index aa40aba..1ebb615 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/OneTimePasswordManager.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.OneTimePasswordManager = function(anUser, args) { | 31 | Clipperz.PM.DataModel.OneTimePasswordManager = function(anUser, args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._user = anUser; | 34 | this._user = anUser; |
37 | this._oneTimePasswords = {}; | 35 | this._oneTimePasswords = {}; |
38 | 36 | ||
39 | this.updateWithData(args); | 37 | this.updateWithData(args); |
40 | 38 | ||
41 | Clipperz.NotificationCenter.notify(null, 'oneTimePasswordAdded', null, true); | 39 | Clipperz.NotificationCenter.notify(null, 'oneTimePasswordAdded', null, true); |
42 | 40 | ||
43 | return this; | 41 | return this; |
44 | } | 42 | } |
45 | 43 | ||
46 | Clipperz.PM.DataModel.OneTimePasswordManager.prototype = MochiKit.Base.update(null, { | 44 | Clipperz.PM.DataModel.OneTimePasswordManager.prototype = MochiKit.Base.update(null, { |
47 | 45 | ||
48 | 'toString': function() { | 46 | 'toString': function() { |
49 | return "Clipperz.PM.DataModel.OneTimePasswordManager"; | 47 | return "Clipperz.PM.DataModel.OneTimePasswordManager"; |
50 | }, | 48 | }, |
51 | 49 | ||
52 | //------------------------------------------------------------------------- | 50 | //------------------------------------------------------------------------- |
53 | 51 | ||
54 | 'updateWithData': function(someValues) { | 52 | 'updateWithData': function(someValues) { |
55 | varotpReference; | 53 | varotpReference; |
56 | 54 | ||
57 | //console.log("OneTimePasswordManager.updateWithData", someValues); | 55 | //console.log("OneTimePasswordManager.updateWithData", someValues); |
58 | //MochiKit.Logging.logDebug("OneTimePasswordManager.updateWithData: " + Clipperz.Base.serializeJSON(someValues)); | 56 | //MochiKit.Logging.logDebug("OneTimePasswordManager.updateWithData: " + Clipperz.Base.serializeJSON(someValues)); |
59 | for (otpReference in someValues) { | 57 | for (otpReference in someValues) { |
60 | var otp; | 58 | var otp; |
61 | var otpConfiguration; | 59 | var otpConfiguration; |
62 | 60 | ||
63 | otpConfiguration = someValues[otpReference]; | 61 | otpConfiguration = someValues[otpReference]; |
64 | otpConfiguration['user'] = this.user(); | 62 | otpConfiguration['user'] = this.user(); |
65 | otpConfiguration['reference'] = otpReference; | 63 | otpConfiguration['reference'] = otpReference; |
66 | otp = new Clipperz.PM.DataModel.OneTimePassword(otpConfiguration); | 64 | otp = new Clipperz.PM.DataModel.OneTimePassword(otpConfiguration); |
67 | this._oneTimePasswords[otpReference] = otp; | 65 | this._oneTimePasswords[otpReference] = otp; |
68 | } | 66 | } |
69 | 67 | ||
70 | return this; | 68 | return this; |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Record.js b/frontend/beta/js/Clipperz/PM/DataModel/Record.js index f89f79c..7b06f29 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/Record.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/Record.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.Record = function(args) { | 31 | Clipperz.PM.DataModel.Record = function(args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._user = args['user'] || null; | 34 | this._user = args['user'] || null; |
37 | this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); | 35 | this._reference = args['reference'] || Clipperz.PM.Crypto.randomKey(); |
38 | this._version = args['version'] || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; | 36 | this._version = args['version'] || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; |
39 | this._key = args['key'] || Clipperz.PM.Crypto.randomKey(); | 37 | this._key = args['key'] || Clipperz.PM.Crypto.randomKey(); |
40 | 38 | ||
41 | this.setLabel(args['label'] || Clipperz.PM.Strings['newRecordTitleLabel']); | 39 | this.setLabel(args['label'] || Clipperz.PM.Strings['newRecordTitleLabel']); |
42 | 40 | ||
43 | this.setHeaderNotes(args['headerNotes'] || null); | 41 | this.setHeaderNotes(args['headerNotes'] || null); |
44 | this.setNotes(args['notes'] || args['headerNotes'] || ""); | 42 | this.setNotes(args['notes'] || args['headerNotes'] || ""); |
45 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _headerNotes: '" + this._headerNotes + "'"); | 43 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _headerNotes: '" + this._headerNotes + "'"); |
46 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _notes: '" + this._notes + "'"); | 44 | //MochiKit.Logging.logDebug("--- new Record ('" + this._label + "')- _notes: '" + this._notes + "'"); |
47 | //this._notes = args.notes || ""; | 45 | //this._notes = args.notes || ""; |
48 | 46 | ||
49 | this._versions = {}; | 47 | this._versions = {}; |
50 | this._directLogins = {}; | 48 | this._directLogins = {}; |
51 | this._removedDirectLogins = []; | 49 | this._removedDirectLogins = []; |
52 | 50 | ||
53 | this.setIsBrandNew(args['reference'] == null); | 51 | this.setIsBrandNew(args['reference'] == null); |
54 | 52 | ||
55 | this.setShouldLoadData(this.isBrandNew() ? false: true); | 53 | this.setShouldLoadData(this.isBrandNew() ? false: true); |
56 | this.setShouldDecryptData(this.isBrandNew() ? false: true); | 54 | this.setShouldDecryptData(this.isBrandNew() ? false: true); |
57 | this.setShouldProcessData(this.isBrandNew() ? false: true); | 55 | this.setShouldProcessData(this.isBrandNew() ? false: true); |
58 | 56 | ||
59 | this.setCurrentVersion(this.isBrandNew() ? new Clipperz.PM.DataModel.RecordVersion(this, null): null); | 57 | this.setCurrentVersion(this.isBrandNew() ? new Clipperz.PM.DataModel.RecordVersion(this, null): null); |
60 | this.setCurrentVersionKey(null); | 58 | this.setCurrentVersionKey(null); |
61 | 59 | ||
62 | this._serverData = null; | 60 | this._serverData = null; |
63 | this._decryptedData = null; | 61 | this._decryptedData = null; |
64 | this._cachedData = null; | 62 | this._cachedData = null; |
65 | 63 | ||
66 | return this; | 64 | return this; |
67 | } | 65 | } |
68 | 66 | ||
69 | Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, { | 67 | Clipperz.PM.DataModel.Record.prototype = MochiKit.Base.update(null, { |
70 | 68 | ||
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js b/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js index bca664d..a5d7980 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/RecordField.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | //############################################################################# | 28 | //############################################################################# |
31 | 29 | ||
32 | Clipperz.PM.DataModel.RecordField = function(args) { | 30 | Clipperz.PM.DataModel.RecordField = function(args) { |
33 | args = args || {}; | 31 | args = args || {}; |
34 | 32 | ||
35 | this._recordVersion = args.recordVersion || null; | 33 | this._recordVersion = args.recordVersion || null; |
36 | this._key = args.key || Clipperz.PM.Crypto.randomKey(); | 34 | this._key = args.key || Clipperz.PM.Crypto.randomKey(); |
37 | this.setLabel(args.label || ''); | 35 | this.setLabel(args.label || ''); |
38 | this.setValue(args.value || ''); | 36 | this.setValue(args.value || ''); |
39 | this.setType(args.type || 'TXT'); //valid types: 'TXT', 'PWD', 'URL', 'DATE', 'ADDR', 'CHECK', 'RADIO', ('NOTE' probably not), ... | 37 | this.setType(args.type || 'TXT'); //valid types: 'TXT', 'PWD', 'URL', 'DATE', 'ADDR', 'CHECK', 'RADIO', ('NOTE' probably not), ... |
40 | this._hidden = args.hidden || (args.type == 'PWD') || false; | 38 | this._hidden = args.hidden || (args.type == 'PWD') || false; |
41 | 39 | ||
42 | return this; | 40 | return this; |
43 | } | 41 | } |
44 | 42 | ||
45 | Clipperz.PM.DataModel.RecordField.prototype = MochiKit.Base.update(null, { | 43 | Clipperz.PM.DataModel.RecordField.prototype = MochiKit.Base.update(null, { |
46 | 44 | ||
47 | 'toString': function() { | 45 | 'toString': function() { |
48 | return "Clipperz.PM.DataModel.RecordField - " + this.label() + " (" + this.key() + ")"; | 46 | return "Clipperz.PM.DataModel.RecordField - " + this.label() + " (" + this.key() + ")"; |
49 | }, | 47 | }, |
50 | 48 | ||
51 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
52 | 50 | ||
53 | 'recordVersion': function() { | 51 | 'recordVersion': function() { |
54 | return this._recordVersion; | 52 | return this._recordVersion; |
55 | }, | 53 | }, |
56 | 54 | ||
57 | //------------------------------------------------------------------------- | 55 | //------------------------------------------------------------------------- |
58 | 56 | ||
59 | 'key': function() { | 57 | 'key': function() { |
60 | return this._key; | 58 | return this._key; |
61 | }, | 59 | }, |
62 | 60 | ||
63 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
64 | 62 | ||
65 | 'label': function() { | 63 | 'label': function() { |
66 | return this._label; | 64 | return this._label; |
67 | }, | 65 | }, |
68 | 66 | ||
69 | 'setLabel': function(aValue) { | 67 | 'setLabel': function(aValue) { |
70 | this._label = aValue; | 68 | this._label = aValue; |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js b/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js index fc4a45c..69a7d91 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/RecordVersion.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.RecordVersion = function(aRecord, args) { | 31 | Clipperz.PM.DataModel.RecordVersion = function(aRecord, args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._record = aRecord; | 34 | this._record = aRecord; |
37 | 35 | ||
38 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); | 36 | this._reference = args.reference || Clipperz.PM.Crypto.randomKey(); |
39 | this._version = args.version || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; | 37 | this._version = args.version || Clipperz.PM.Crypto.encryptingFunctions.currentVersion; |
40 | this._key = args.key || Clipperz.PM.Crypto.randomKey();; | 38 | this._key = args.key || Clipperz.PM.Crypto.randomKey();; |
41 | 39 | ||
42 | this._previousVersion = args.previousVersion || null; | 40 | this._previousVersion = args.previousVersion || null; |
43 | this._previousVersionKey = args.previousVersionKey || null; | 41 | this._previousVersionKey = args.previousVersionKey || null; |
44 | 42 | ||
45 | this.setIsBrandNew(args.reference == null); | 43 | this.setIsBrandNew(args.reference == null); |
46 | 44 | ||
47 | if (this.isBrandNew()) { | 45 | if (this.isBrandNew()) { |
48 | this._fields = {}; | 46 | this._fields = {}; |
49 | 47 | ||
50 | this.setShouldLoadData(false); | 48 | this.setShouldLoadData(false); |
51 | this.setShouldDecryptData(false); | 49 | this.setShouldDecryptData(false); |
52 | this.setShouldProcessData(false); | 50 | this.setShouldProcessData(false); |
53 | } else { | 51 | } else { |
54 | if (typeof(args.fields) != 'undefined') { | 52 | if (typeof(args.fields) != 'undefined') { |
55 | this.processFieldData(args.fields); | 53 | this.processFieldData(args.fields); |
56 | 54 | ||
57 | this.setShouldLoadData(false); | 55 | this.setShouldLoadData(false); |
58 | this.setShouldDecryptData(false); | 56 | this.setShouldDecryptData(false); |
59 | this.setShouldProcessData(false); | 57 | this.setShouldProcessData(false); |
60 | } else { | 58 | } else { |
61 | if (typeof(args.data) != 'undefined') { | 59 | if (typeof(args.data) != 'undefined') { |
62 | this.setShouldLoadData(false); | 60 | this.setShouldLoadData(false); |
63 | } else { | 61 | } else { |
64 | this.setShouldLoadData(true); | 62 | this.setShouldLoadData(true); |
65 | } | 63 | } |
66 | this.setShouldDecryptData(true); | 64 | this.setShouldDecryptData(true); |
67 | this.setShouldProcessData(true); | 65 | this.setShouldProcessData(true); |
68 | } | 66 | } |
69 | } | 67 | } |
70 | 68 | ||
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js b/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js index 3d53adf..f0c229e 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/Statistics.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.Statistics = function(args) { | 31 | Clipperz.PM.DataModel.Statistics = function(args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._user = args.user; | 34 | this._user = args.user; |
37 | this._data = args.data || null; | 35 | this._data = args.data || null; |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | Clipperz.PM.DataModel.Statistics.prototype = MochiKit.Base.update(null, { | 40 | Clipperz.PM.DataModel.Statistics.prototype = MochiKit.Base.update(null, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'decrypt': function(aVersion, someEncryptedData) { | 44 | 'decrypt': function(aVersion, someEncryptedData) { |
47 | var deferredResult; | 45 | var deferredResult; |
48 | 46 | ||
49 | //MochiKit.Logging.logDebug(">>> Statistics.decrypt"); | 47 | //MochiKit.Logging.logDebug(">>> Statistics.decrypt"); |
50 | if (someEncryptedData == Clipperz.PM.Crypto.nullValue) { | 48 | if (someEncryptedData == Clipperz.PM.Crypto.nullValue) { |
51 | this.setData({}); | 49 | this.setData({}); |
52 | deferredResult = MochiKit.Async.succeed(this.data()); | 50 | deferredResult = MochiKit.Async.succeed(this.data()); |
53 | } else { | 51 | } else { |
54 | varstatistic; | 52 | varstatistic; |
55 | var user; | 53 | var user; |
56 | 54 | ||
57 | statistic = this; | 55 | statistic = this; |
58 | user = this.user(); | 56 | user = this.user(); |
59 | deferredResult = new MochiKit.Async.Deferred(); | 57 | deferredResult = new MochiKit.Async.Deferred(); |
60 | //deferredResult.addCallback(function() { console.time("Statistics.decrypt.deferredDecrypt")}); | 58 | //deferredResult.addCallback(function() { console.time("Statistics.decrypt.deferredDecrypt")}); |
61 | deferredResult.addCallback(Clipperz.PM.Crypto.deferredDecrypt, user.passphrase(), someEncryptedData, aVersion); | 59 | deferredResult.addCallback(Clipperz.PM.Crypto.deferredDecrypt, user.passphrase(), someEncryptedData, aVersion); |
62 | //deferredResult.addCallback(function() { console.timeEnd("Statistics.decrypt.deferredDecrypt")}); | 60 | //deferredResult.addCallback(function() { console.timeEnd("Statistics.decrypt.deferredDecrypt")}); |
63 | //deferredResult.addCallback(function() { console.time("Statistics.decrypt.setup")}); | 61 | //deferredResult.addCallback(function() { console.time("Statistics.decrypt.setup")}); |
64 | deferredResult.addCallbacks( | 62 | deferredResult.addCallbacks( |
65 | MochiKit.Base.partial(function (aStatistic, someData) { | 63 | MochiKit.Base.partial(function (aStatistic, someData) { |
66 | aStatistic.setData(someData); | 64 | aStatistic.setData(someData); |
67 | return aStatistic.data(); | 65 | return aStatistic.data(); |
68 | }, statistic), | 66 | }, statistic), |
69 | MochiKit.Base.partial(function (aStatistic) { | 67 | MochiKit.Base.partial(function (aStatistic) { |
70 | MochiKit.Logging.logWarning("resetting user statistics due to an error while decrypting stored data"); | 68 | MochiKit.Logging.logWarning("resetting user statistics due to an error while decrypting stored data"); |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/User.js b/frontend/beta/js/Clipperz/PM/DataModel/User.js index b29d224..3067742 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/User.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/User.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.User = function(args) { | 31 | Clipperz.PM.DataModel.User = function(args) { |
34 | //MochiKit.Logging.logDebug(">>> new User"); | 32 | //MochiKit.Logging.logDebug(">>> new User"); |
35 | args = args || {}; | 33 | args = args || {}; |
36 | 34 | ||
37 | this._username = args.username || null; | 35 | this._username = args.username || null; |
38 | this._passphrase = args.passphrase || null; | 36 | this._passphrase = args.passphrase || null; |
39 | 37 | ||
40 | this._connection = null; | 38 | this._connection = null; |
41 | this._connectionVersion = 'current'; | 39 | this._connectionVersion = 'current'; |
42 | 40 | ||
43 | this._header = null; | 41 | this._header = null; |
44 | this._statistics = null; | 42 | this._statistics = null; |
45 | this._lock = 'new lock'; | 43 | this._lock = 'new lock'; |
46 | 44 | ||
47 | this._preferences = null; | 45 | this._preferences = null; |
48 | this._records = {}; | 46 | this._records = {}; |
49 | this._directLoginReferences = {}; | 47 | this._directLoginReferences = {}; |
50 | this._oneTimePasswordManager = null; | 48 | this._oneTimePasswordManager = null; |
51 | 49 | ||
52 | this._isLoadingUserDetails = false; | 50 | this._isLoadingUserDetails = false; |
53 | this._loadingUserDetailsPendingQueue = []; | 51 | this._loadingUserDetailsPendingQueue = []; |
54 | 52 | ||
55 | this._maxNumberOfRecords = Number.MAX_VALUE; | 53 | this._maxNumberOfRecords = Number.MAX_VALUE; |
56 | 54 | ||
57 | this._shouldDownloadOfflineCopy = false; | 55 | this._shouldDownloadOfflineCopy = false; |
58 | 56 | ||
59 | this._loginInfo = null; | 57 | this._loginInfo = null; |
60 | this._loginHistory = null; | 58 | this._loginHistory = null; |
61 | 59 | ||
62 | this._serverData = null; | 60 | this._serverData = null; |
63 | //MochiKit.Logging.logDebug("<<< new User"); | 61 | //MochiKit.Logging.logDebug("<<< new User"); |
64 | 62 | ||
65 | return this; | 63 | return this; |
66 | } | 64 | } |
67 | 65 | ||
68 | Clipperz.PM.DataModel.User.prototype = MochiKit.Base.update(null, { | 66 | Clipperz.PM.DataModel.User.prototype = MochiKit.Base.update(null, { |
69 | 67 | ||
70 | 'toString': function() { | 68 | 'toString': function() { |
diff --git a/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js b/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js index 919289d..d44ad89 100644 --- a/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js +++ b/frontend/beta/js/Clipperz/PM/DataModel/UserPreferences.js | |||
@@ -1,70 +1,68 @@ | |||
1 | /* | 1 | /* |
2 | 2 | ||
3 | Copyright 2008-2011 Clipperz Srl | 3 | Copyright 2008-2013 Clipperz Srl |
4 | 4 | ||
5 | This file is part of Clipperz Community Edition. | 5 | This file is part of Clipperz, the online password manager. |
6 | Clipperz Community Edition is an online password manager. | ||
7 | For further information about its features and functionalities please | 6 | For further information about its features and functionalities please |
8 | refer to http://www.clipperz.com. | 7 | refer to http://www.clipperz.com. |
9 | 8 | ||
10 | * Clipperz Community Edition is free software: you can redistribute | 9 | * Clipperz is free software: you can redistribute it and/or modify it |
11 | it and/or modify it under the terms of the GNU Affero General Public | 10 | under the terms of the GNU Affero General Public License as published |
12 | License as published by the Free Software Foundation, either version | 11 | by the Free Software Foundation, either version 3 of the License, or |
13 | 3 of the License, or (at your option) any later version. | 12 | (at your option) any later version. |
14 | 13 | ||
15 | * Clipperz Community Edition is distributed in the hope that it will | 14 | * Clipperz is distributed in the hope that it will be useful, but |
16 | be useful, but WITHOUT ANY WARRANTY; without even the implied | 15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. | 17 | See the GNU Affero General Public License for more details. |
19 | 18 | ||
20 | * You should have received a copy of the GNU Affero General Public | 19 | * You should have received a copy of the GNU Affero General Public |
21 | License along with Clipperz Community Edition. If not, see | 20 | License along with Clipperz. If not, see http://www.gnu.org/licenses/. |
22 | <http://www.gnu.org/licenses/>. | ||
23 | 21 | ||
24 | */ | 22 | */ |
25 | 23 | ||
26 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } | 24 | if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } |
27 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } | 25 | if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } |
28 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } | 26 | if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } |
29 | 27 | ||
30 | 28 | ||
31 | //############################################################################# | 29 | //############################################################################# |
32 | 30 | ||
33 | Clipperz.PM.DataModel.UserPreferences = function(args) { | 31 | Clipperz.PM.DataModel.UserPreferences = function(args) { |
34 | args = args || {}; | 32 | args = args || {}; |
35 | 33 | ||
36 | this._user = args['user']; delete args['user']; | 34 | this._user = args['user']; delete args['user']; |
37 | this._config = args; | 35 | this._config = args; |
38 | 36 | ||
39 | return this; | 37 | return this; |
40 | } | 38 | } |
41 | 39 | ||
42 | Clipperz.PM.DataModel.UserPreferences.prototype = MochiKit.Base.update(null, { | 40 | Clipperz.PM.DataModel.UserPreferences.prototype = MochiKit.Base.update(null, { |
43 | 41 | ||
44 | //------------------------------------------------------------------------- | 42 | //------------------------------------------------------------------------- |
45 | 43 | ||
46 | 'config': function() { | 44 | 'config': function() { |
47 | return this._config; | 45 | return this._config; |
48 | }, | 46 | }, |
49 | 47 | ||
50 | //------------------------------------------------------------------------- | 48 | //------------------------------------------------------------------------- |
51 | 49 | ||
52 | 'user': function() { | 50 | 'user': function() { |
53 | return this._user; | 51 | return this._user; |
54 | }, | 52 | }, |
55 | 53 | ||
56 | //------------------------------------------------------------------------- | 54 | //------------------------------------------------------------------------- |
57 | 55 | ||
58 | 'updateWithData': function(someValues) { | 56 | 'updateWithData': function(someValues) { |
59 | var currentLanguage; | 57 | var currentLanguage; |
60 | 58 | ||
61 | //MochiKit.Logging.logDebug(">>> Clipperz.PM.DataModel.UserPreferences.updateWithData: " + Clipperz.Base.serializeJSON(someValues)); | 59 | //MochiKit.Logging.logDebug(">>> Clipperz.PM.DataModel.UserPreferences.updateWithData: " + Clipperz.Base.serializeJSON(someValues)); |
62 | currentLanguage = this.preferredLanguage(); | 60 | currentLanguage = this.preferredLanguage(); |
63 | 61 | ||
64 | MochiKit.Base.update(this._config, someValues); | 62 | MochiKit.Base.update(this._config, someValues); |
65 | 63 | ||
66 | if (this.preferredLanguage() != currentLanguage) { | 64 | if (this.preferredLanguage() != currentLanguage) { |
67 | Clipperz.PM.Strings.Languages.setSelectedLanguage(this.preferredLanguage()); | 65 | Clipperz.PM.Strings.Languages.setSelectedLanguage(this.preferredLanguage()); |
68 | } else { | 66 | } else { |
69 | //MochiKit.Logging.logDebug("### keepping the browser selected language: " + Clipperz.PM.Strings.selectedLanguage); | 67 | //MochiKit.Logging.logDebug("### keepping the browser selected language: " + Clipperz.PM.Strings.selectedLanguage); |
70 | } | 68 | } |