1
0
mirror of http://git.whoc.org.uk/git/password-manager.git synced 2025-10-29 10:27:35 +01:00

Added support for Direct Login removal

This commit is contained in:
Dario Chiappetta
2015-08-26 23:03:41 +02:00
parent 5cfd6588d7
commit 4ed3412cd8
6 changed files with 74 additions and 32 deletions

View File

@@ -699,7 +699,7 @@ Clipperz.Base.extend(Clipperz.PM.Proxy.Offline.DataStore, Object, {
} else if (someParameters.message == 'updateOneTimePasswords') {
if (this.isReadOnly() == false) {
console.log("Proxy.Offline.DataStore.updateOneTimePasswords: someParameters:", someParameters);
//console.log("Proxy.Offline.DataStore.updateOneTimePasswords: someParameters:", someParameters);
if (aConnection['userData']['lock'] != someParameters['parameters']['user']['lock']) {
throw "the lock attribute is not processed correctly"
@@ -709,7 +709,7 @@ console.log("Proxy.Offline.DataStore.updateOneTimePasswords: someParameters:", s
aConnection['userData']['statistics'] = someParameters['parameters']['user']['statistics'];
aConnection['userData']['userDetailsVersion'] = someParameters['parameters']['user']['version'];
console.log("Proxy.Offline.DataStore.updateOneTimePasswords: userOTPs:", aConnection['userOTPs']);
//console.log("Proxy.Offline.DataStore.updateOneTimePasswords: userOTPs:", aConnection['userOTPs']);
MochiKit.Base.map(function(aOTP) {
if (someParameters['parameters']['oneTimePasswords'].indexOf(aOTP.reference) < 0) {

View File

@@ -54,6 +54,10 @@ Clipperz.PM.UI.Components.Cards.EditClass = React.createClass({
return this.props['fields'];
},
reference: function() {
return this.props['_reference'];
},
//============================================================================
positionOfField: function (aFieldReference) {
@@ -446,6 +450,10 @@ console.log("DROP"); //, anEvent);
this.setState({'passwordGeneratorFieldReference': null});
},
removeDirectLogin: function(aDirectLoginReference) {
MochiKit.Signal.signal(Clipperz.Signal.NotificationCenter, 'removeDirectLogin', this.record(), aDirectLoginReference);
},
//============================================================================
renderLabel: function (aLabel) {
@@ -580,6 +588,10 @@ console.log("DROP"); //, anEvent);
renderDirectLogin: function (aDirectLogin) {
return React.DOM.div({'className':'cardDirectLogin', 'key':aDirectLogin['_reference']}, [
React.DOM.a({
'className': 'removeDirectLogin',
'onClick': MochiKit.Base.method(this, 'removeDirectLogin', aDirectLogin['_reference'])
}, "remove field"),
React.DOM.span({'className':'directLoginLabel'}, aDirectLogin['label']),
// React.DOM.div({'className':'directLoginAction action'}, 'DIRECT LOGIN')
]);

View File

@@ -83,7 +83,7 @@ Clipperz.PM.UI.MainController = function() {
'maskClick',
'closeHelp',
'downloadOfflineCopy',
'runDirectLogin',
'runDirectLogin', 'removeDirectLogin',
'exitSearch'
]);
@@ -825,6 +825,21 @@ console.log("THE BROWSER IS OFFLINE");
return deferredResult;
},
removeDirectLogin_handler: function (aRecord, aDirectLoginReference) {
var deferredResult;
deferredResult = new Clipperz.Async.Deferred("MainController.removeDirectLogin_handler", {'trace': false});
deferredResult.addMethodcaller('directLogins');
deferredResult.addCallback(MochiKit.Base.itemgetter(aDirectLoginReference));
deferredResult.addMethodcaller('remove');
deferredResult.addCallback(MochiKit.Base.partial(MochiKit.Signal.signal, Clipperz.Signal.NotificationCenter, 'refreshCardEditDetail', aRecord.reference()));
deferredResult.callback(aRecord);
return deferredResult;
},
/*
shouldExitApp: function (anEvent) {
//console.log("SHOULD EXIT APP");