Diffstat (limited to 'frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js') (more/less context) (ignore whitespace changes)
-rw-r--r-- | frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js index 0ee8599..3528db6 100644 --- a/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js +++ b/frontend/gamma/js/Clipperz/PM/DataModel/User.Header.OneTimePasswords.js | |||
@@ -1,128 +1,125 @@ | |||
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 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { | 26 | try { if (typeof(Clipperz.PM.DataModel.User) == 'undefined') { throw ""; }} catch (e) { |
30 | throw "Clipperz.PM.DataModel.User.Header.OneTimePasswords depends on Clipperz.PM.DataModel.User!"; | 27 | throw "Clipperz.PM.DataModel.User.Header.OneTimePasswords depends on Clipperz.PM.DataModel.User!"; |
31 | } | 28 | } |
32 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } | 29 | if (typeof(Clipperz.PM.DataModel.User.Header) == 'undefined') { Clipperz.PM.DataModel.User.Header = {}; } |
33 | 30 | ||
34 | //----------------------------------------------------------------------------- | 31 | //----------------------------------------------------------------------------- |
35 | 32 | ||
36 | Clipperz.PM.DataModel.User.Header.OneTimePasswords = function(args) { | 33 | Clipperz.PM.DataModel.User.Header.OneTimePasswords = function(args) { |
37 | Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.constructor.apply(this, arguments); | 34 | Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.constructor.apply(this, arguments); |
38 | 35 | ||
39 | this._oneTimePasswords = null; | 36 | this._oneTimePasswords = null; |
40 | 37 | ||
41 | return this; | 38 | return this; |
42 | } | 39 | } |
43 | 40 | ||
44 | //----------------------------------------------------------------------------- | 41 | //----------------------------------------------------------------------------- |
45 | 42 | ||
46 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.OneTimePasswords, Clipperz.PM.DataModel.EncryptedRemoteObject, { | 43 | Clipperz.Base.extend(Clipperz.PM.DataModel.User.Header.OneTimePasswords, Clipperz.PM.DataModel.EncryptedRemoteObject, { |
47 | 44 | ||
48 | 'toString': function() { | 45 | 'toString': function() { |
49 | return "Clipperz.PM.DataModel.User.Header.OneTimePasswords"; | 46 | return "Clipperz.PM.DataModel.User.Header.OneTimePasswords"; |
50 | }, | 47 | }, |
51 | 48 | ||
52 | //------------------------------------------------------------------------- | 49 | //------------------------------------------------------------------------- |
53 | /* | 50 | /* |
54 | 'packData': function (someData) { //++ | 51 | 'packData': function (someData) { //++ |
55 | var result; | 52 | var result; |
56 | 53 | ||
57 | console.log(">>> OneTimePasswords.packData", someData); | 54 | console.log(">>> OneTimePasswords.packData", someData); |
58 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packData.apply(this, arguments); | 55 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packData.apply(this, arguments); |
59 | console.log("<<< OneTimePasswords.packData"); | 56 | console.log("<<< OneTimePasswords.packData"); |
60 | 57 | ||
61 | return result; | 58 | return result; |
62 | }, | 59 | }, |
63 | */ | 60 | */ |
64 | //------------------------------------------------------------------------- | 61 | //------------------------------------------------------------------------- |
65 | /* | 62 | /* |
66 | 'packRemoteData': function (someData) { | 63 | 'packRemoteData': function (someData) { |
67 | var result; | 64 | var result; |
68 | 65 | ||
69 | console.log(">>> OneTimePasswords.packRemoteData", someData); | 66 | console.log(">>> OneTimePasswords.packRemoteData", someData); |
70 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packRemoteData.apply(this, arguments); | 67 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.packRemoteData.apply(this, arguments); |
71 | console.log("<<< OneTimePasswords.packRemoteData"); | 68 | console.log("<<< OneTimePasswords.packRemoteData"); |
72 | 69 | ||
73 | return result; | 70 | return result; |
74 | }, | 71 | }, |
75 | */ | 72 | */ |
76 | //------------------------------------------------------------------------- | 73 | //------------------------------------------------------------------------- |
77 | /* | 74 | /* |
78 | 'prepareRemoteDataWithKey': function (aKey) { | 75 | 'prepareRemoteDataWithKey': function (aKey) { |
79 | var result; | 76 | var result; |
80 | 77 | ||
81 | console.log(">>> OneTimePasswords.prepareRemoteDataWithKey"); | 78 | console.log(">>> OneTimePasswords.prepareRemoteDataWithKey"); |
82 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.prepareRemoteDataWithKey.apply(this, arguments); | 79 | result = Clipperz.PM.DataModel.User.Header.OneTimePasswords.superclass.prepareRemoteDataWithKey.apply(this, arguments); |
83 | console.log("<<< OneTimePasswords.prepareRemoteDataWithKey"); | 80 | console.log("<<< OneTimePasswords.prepareRemoteDataWithKey"); |
84 | 81 | ||
85 | return result; | 82 | return result; |
86 | }, | 83 | }, |
87 | */ | 84 | */ |
88 | //========================================================================= | 85 | //========================================================================= |
89 | 86 | ||
90 | 'oneTimePasswords': function () { | 87 | 'oneTimePasswords': function () { |
91 | vardeferredResult; | 88 | vardeferredResult; |
92 | 89 | ||
93 | deferredResult = new Clipperz.Async.Deferred("User.Header.OneTimePasswords.oneTimePasswords", {trace:false}); | 90 | deferredResult = new Clipperz.Async.Deferred("User.Header.OneTimePasswords.oneTimePasswords", {trace:false}); |
94 | if (this._oneTimePasswords == null) { | 91 | if (this._oneTimePasswords == null) { |
95 | deferredResult.addMethod(this, 'values') | 92 | deferredResult.addMethod(this, 'values') |
96 | deferredResult.addCallback(MochiKit.Base.bind(function (someData) { | 93 | deferredResult.addCallback(MochiKit.Base.bind(function (someData) { |
97 | varotpKey; | 94 | varotpKey; |
98 | 95 | ||
99 | this._oneTimePasswords = {}; | 96 | this._oneTimePasswords = {}; |
100 | 97 | ||
101 | for (otpKey in someData) { | 98 | for (otpKey in someData) { |
102 | var otp; | 99 | var otp; |
103 | var otpParameters; | 100 | var otpParameters; |
104 | 101 | ||
105 | otpParameters = Clipperz.Base.deepClone(someData[otpKey]); | 102 | otpParameters = Clipperz.Base.deepClone(someData[otpKey]); |
106 | otpParameters['reference'] = otpKey; | 103 | otpParameters['reference'] = otpKey; |
107 | 104 | ||
108 | otp = new Clipperz.PM.DataModel.OneTimePassword(otpParameters); | 105 | otp = new Clipperz.PM.DataModel.OneTimePassword(otpParameters); |
109 | this._oneTimePasswords[otpKey] = otp; | 106 | this._oneTimePasswords[otpKey] = otp; |
110 | } | 107 | } |
111 | 108 | ||
112 | return this._oneTimePasswords; | 109 | return this._oneTimePasswords; |
113 | 110 | ||
114 | }, this)); | 111 | }, this)); |
115 | deferredResult.callback(); | 112 | deferredResult.callback(); |
116 | } else { | 113 | } else { |
117 | deferredResult = MochiKit.Async.succeed(this._oneTimePasswords); | 114 | deferredResult = MochiKit.Async.succeed(this._oneTimePasswords); |
118 | } | 115 | } |
119 | 116 | ||
120 | return deferredResult; | 117 | return deferredResult; |
121 | }, | 118 | }, |
122 | 119 | ||
123 | //========================================================================= | 120 | //========================================================================= |
124 | __syntaxFix__: "syntax fix" | 121 | __syntaxFix__: "syntax fix" |
125 | }); | 122 | }); |
126 | 123 | ||
127 | //----------------------------------------------------------------------------- | 124 | //----------------------------------------------------------------------------- |
128 | 125 | ||