author | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
---|---|---|
committer | Clipperz <info@clipperz.com> | 2013-01-31 13:42:04 (UTC) |
commit | 07d0357beef5d9328a2dd8d07ad7b39c87ac55e4 (patch) (side-by-side diff) | |
tree | f7a4aed8848302db153c2a211f8e58b944eb4c5b /frontend/beta/js/Clipperz/PM/DataModel/User.js | |
parent | 767a3dcf48b6ac911c088af5dd7738a728eb6b99 (diff) | |
download | clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.zip clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.gz clipperz-07d0357beef5d9328a2dd8d07ad7b39c87ac55e4.tar.bz2 |
Updated Copyright claims
- updated reference dates;
- removed reference to Community Edition;
- normalized logging using Clipperz.log[Warn|Error|Debug]
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 | 22 |
1 files changed, 10 insertions, 12 deletions
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,214 +1,212 @@ /* -Copyright 2008-2011 Clipperz Srl +Copyright 2008-2013 Clipperz Srl -This file is part of Clipperz Community Edition. -Clipperz Community Edition is an online password manager. +This file is part of Clipperz, the online password manager. For further information about its features and functionalities please refer to http://www.clipperz.com. -* Clipperz Community Edition is free software: you can redistribute - it and/or modify it under the terms of the GNU Affero General Public - License as published by the Free Software Foundation, either version - 3 of the License, or (at your option) any later version. +* Clipperz is free software: you can redistribute it and/or modify it + under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. -* Clipperz Community Edition is distributed in the hope that it will - be useful, but WITHOUT ANY WARRANTY; without even the implied - warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +* Clipperz is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details. * You should have received a copy of the GNU Affero General Public - License along with Clipperz Community Edition. If not, see - <http://www.gnu.org/licenses/>. + License along with Clipperz. If not, see http://www.gnu.org/licenses/. */ if (typeof(Clipperz) == 'undefined') { Clipperz = {}; } if (typeof(Clipperz.PM) == 'undefined') { Clipperz.PM = {}; } if (typeof(Clipperz.PM.DataModel) == 'undefined') { Clipperz.PM.DataModel = {}; } //############################################################################# Clipperz.PM.DataModel.User = function(args) { //MochiKit.Logging.logDebug(">>> new User"); args = args || {}; this._username = args.username || null; this._passphrase = args.passphrase || null; this._connection = null; this._connectionVersion = 'current'; this._header = null; this._statistics = null; this._lock = 'new lock'; this._preferences = null; this._records = {}; this._directLoginReferences = {}; this._oneTimePasswordManager = null; this._isLoadingUserDetails = false; this._loadingUserDetailsPendingQueue = []; this._maxNumberOfRecords = Number.MAX_VALUE; this._shouldDownloadOfflineCopy = false; this._loginInfo = null; this._loginHistory = null; this._serverData = null; //MochiKit.Logging.logDebug("<<< new User"); return this; } Clipperz.PM.DataModel.User.prototype = MochiKit.Base.update(null, { 'toString': function() { return "Clipperz.PM.DataModel.User - " + this.username(); }, //------------------------------------------------------------------------- 'username': function() { return this._username; }, 'setUsername': function(aValue) { this._username = aValue; }, //------------------------------------------------------------------------- 'passphrase': function() { return this._passphrase; }, 'setPassphrase': function(aValue) { this._passphrase = aValue; }, //------------------------------------------------------------------------- 'maxNumberOfRecords': function() { return this._maxNumberOfRecords; }, 'setMaxNumberOfRecords': function(aValue) { this._maxNumberOfRecords = aValue; }, //------------------------------------------------------------------------- 'errorHandler': function(anErrorString, anException) { MochiKit.Logging.logError("- User.errorHandler: " + anErrorString + " (" + anException + ")"); }, //------------------------------------------------------------------------- 'connectionVersion': function() { return this._connectionVersion; }, 'setConnectionVersion': function(aValue) { this._connectionVersion = aValue; }, //------------------------------------------------------------------------- 'connection': function() { if ((this._connection == null) && (this.connectionVersion() != null) ){ this._connection = new Clipperz.PM.Crypto.communicationProtocol.versions[this.connectionVersion()]({user:this}); } return this._connection; }, 'resetConnection': function(aValue) { this._connection = null; }, //========================================================================= 'register': function(anInvitationCode) { var deferredResult; var prng; //MochiKit.Logging.logError(">>> User.register: " + this); prng = Clipperz.Crypto.PRNG.defaultRandomGenerator(); deferredResult = new MochiKit.Async.Deferred() //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.register - 1: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(prng, 'deferredEntropyCollection')); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.register - 2: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(this.header(), 'updateAllSections'), anInvitationCode); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.register - 2.1: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(this.connection(), 'register'), anInvitationCode); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("User.register - 3: " + res); return res;}); deferredResult.callback(); //MochiKit.Logging.logError("<<< User.register"); return deferredResult; }, //========================================================================= 'connect': function(aValue) { var deferredResult; var prng; prng = Clipperz.Crypto.PRNG.defaultRandomGenerator(); //MochiKit.Logging.logDebug(">>> User.connect"); deferredResult = new MochiKit.Async.Deferred(); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.1 - User.connect - 1: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(prng, 'deferredEntropyCollection')); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.2 - User.connect - 2: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(this.connection(), 'login')); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.3 - User.connect - 3: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); // TODO: add an addErrback call here to manage a wrong login. Any error after this point is due to some other causes. // possibly the same exact 'handleConnectionFallback use at the end of this same method. if (this.connectionVersion() != 'current') { var currentConnection; currentVersionConnection = new Clipperz.PM.Crypto.communicationProtocol.versions['current']({user:this}); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.4 - User.connect - 4: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'updatedProgressState', 'connection_upgrading'); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.5 - User.connect - 5: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); deferredResult.addCallback(MochiKit.Base.method(this.connection(), 'message'), 'upgradeUserCredentials', currentVersionConnection.serverSideUserCredentials()); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.6 - User.connect - 6: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); } //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.7 - User.connect - 7: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); deferredResult.addCallback(Clipperz.NotificationCenter.deferredNotification, this, 'userConnected', null); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.8 - User.connect - 8: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); deferredResult.addErrback(MochiKit.Base.method(this, 'handleConnectionFallback')); //deferredResult.addBoth(function(res) {MochiKit.Logging.logDebug("1.2.9 - User.connect - 9: "/* + res*/); return res;}); //deferredResult.addErrback(function(res) {MochiKit.Logging.logDebug("ERROR: " + res); return res;}); deferredResult.callback(aValue); //MochiKit.Logging.logDebug("<<< User.connect"); return deferredResult; }, //......................................................................... 'handleConnectionFallback': function(aValue) { var result; //MochiKit.Logging.logDebug(">>> User.handleConnectionFallback"); if (aValue instanceof MochiKit.Async.CancelledError) { |