mirror of
https://github.com/nextcloud/passman.git
synced 2025-10-18 09:27:02 +08:00
Remove unused code
This commit is contained in:
parent
b658e2a4ca
commit
1a74def8dc
38 changed files with 72 additions and 84 deletions
|
@ -89,7 +89,6 @@
|
|||
$scope.sharing_keys = {};
|
||||
$scope.newVault = function () {
|
||||
$scope.creating_vault = true;
|
||||
var _vault = {};
|
||||
var key_size = 1024;
|
||||
ShareService.generateRSAKeys(key_size).progress(function (progress) {
|
||||
var p = progress > 0 ? 2 : 1;
|
||||
|
@ -121,7 +120,7 @@
|
|||
|
||||
VaultService.setActiveVault(_vault);
|
||||
try {
|
||||
var c = EncryptService.decryptString(vault.challenge_password);
|
||||
EncryptService.decryptString(vault.challenge_password);
|
||||
if ($scope.remember_vault_password) {
|
||||
SettingsService.setSetting('defaultVaultPass', vault_key);
|
||||
}
|
||||
|
@ -149,10 +148,10 @@
|
|||
test_credential.hidden = true;
|
||||
test_credential.vault_id = vault.vault_id;
|
||||
test_credential.password = 'lorum ipsum';
|
||||
CredentialService.createCredential(test_credential).then(function (result) {
|
||||
CredentialService.createCredential(test_credential).then(function () {
|
||||
_vault.public_sharing_key = angular.copy($scope.sharing_keys.public_sharing_key);
|
||||
_vault.private_sharing_key = EncryptService.encryptString(angular.copy($scope.sharing_keys.private_sharing_key));
|
||||
VaultService.updateSharingKeys(_vault).then(function (result) {
|
||||
VaultService.updateSharingKeys(_vault).then(function () {
|
||||
_loginToVault(vault, vault_key);
|
||||
});
|
||||
});
|
||||
|
@ -351,7 +350,7 @@
|
|||
if (!$scope.storedCredential.credential_id) {
|
||||
$scope.storedCredential.vault_id = $scope.active_vault.vault_id;
|
||||
|
||||
CredentialService.createCredential($scope.storedCredential).then(function (result) {
|
||||
CredentialService.createCredential($scope.storedCredential).then(function () {
|
||||
NotificationService.showNotification('Credential created!', 5000);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -138,7 +138,7 @@
|
|||
crypted_shared_key = private_key.decrypt(forge.util.decode64(crypted_shared_key));
|
||||
crypted_shared_key = EncryptService.encryptString(crypted_shared_key);
|
||||
|
||||
ShareService.saveSharingRequest(share_request, crypted_shared_key).then(function (result) {
|
||||
ShareService.saveSharingRequest(share_request, crypted_shared_key).then(function () {
|
||||
var idx = $scope.incoming_share_requests.indexOf(share_request);
|
||||
$scope.incoming_share_requests.splice(idx, 1);
|
||||
var active_share_requests = false;
|
||||
|
@ -249,7 +249,7 @@
|
|||
}
|
||||
NotificationService.showNotification('Credential recovered', 5000,
|
||||
function () {
|
||||
CredentialService.updateCredential(_credential).then(function (result) {
|
||||
CredentialService.updateCredential(_credential).then(function () {
|
||||
notification = false;
|
||||
|
||||
});
|
||||
|
@ -259,7 +259,7 @@
|
|||
|
||||
$scope.destroyCredential = function (credential) {
|
||||
var _credential = angular.copy(credential);
|
||||
CredentialService.destroyCredential(_credential.credential_id).then(function (result) {
|
||||
CredentialService.destroyCredential(_credential.credential_id).then(function () {
|
||||
for (var i = 0; i < $scope.active_vault.credentials.length; i++) {
|
||||
if ($scope.active_vault.credentials[i].credential_id === credential.credential_id) {
|
||||
$scope.active_vault.credentials.splice(i, 1);
|
||||
|
|
|
@ -231,7 +231,7 @@
|
|||
|
||||
if (!$scope.storedCredential.credential_id) {
|
||||
$scope.storedCredential.vault_id = $scope.active_vault.vault_id;
|
||||
CredentialService.createCredential($scope.storedCredential).then(function (result) {
|
||||
CredentialService.createCredential($scope.storedCredential).then(function () {
|
||||
$location.path('/vault/' + $routeParams.vault_id);
|
||||
NotificationService.showNotification('Credential created!', 5000);
|
||||
});
|
||||
|
@ -259,7 +259,7 @@
|
|||
var _useKey = (key != null);
|
||||
var regex = /(<([^>]+)>)/ig;
|
||||
_credential.description = _credential.description.replace(regex, "");
|
||||
CredentialService.updateCredential(_credential, _useKey).then(function (result) {
|
||||
CredentialService.updateCredential(_credential, _useKey).then(function () {
|
||||
SettingsService.setSetting('edit_credential', null);
|
||||
$location.path('/vault/' + $routeParams.vault_id);
|
||||
NotificationService.showNotification('Credential updated!', 5000);
|
||||
|
|
|
@ -42,9 +42,9 @@
|
|||
};
|
||||
|
||||
$scope.fileLoadError = function (file) {
|
||||
console.error('Error loading file');
|
||||
console.error('Error loading file', file);
|
||||
};
|
||||
$scope.fileSelectProgress = function (progress) {
|
||||
$scope.fileSelectProgress = function () {
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
|
||||
$scope.downloadFile = function (credential, file) {
|
||||
ShareService.downloadSharedFile(credential, file).then(function (result) {
|
||||
var key = null;
|
||||
if (!result.hasOwnProperty('file_data')) {
|
||||
NotificationService.showNotification('Error downloading file, you probably don\'t have enough permissions', 5000);
|
||||
return;
|
||||
|
|
|
@ -111,7 +111,7 @@
|
|||
|
||||
//Used in activity
|
||||
_credential.revision_created = $filter('date')(_revision.created * 1000, "dd-MM-yyyy @ HH:mm:ss");
|
||||
CredentialService.updateCredential(_credential, (key)).then(function (result) {
|
||||
CredentialService.updateCredential(_credential, (key)).then(function () {
|
||||
SettingsService.setSetting('revision_credential', null);
|
||||
$rootScope.$emit('app_menu', false);
|
||||
$location.path('/vault/' + $routeParams.vault_id);
|
||||
|
|
|
@ -10,8 +10,8 @@
|
|||
* This file is part of passman, licensed under AGPLv3
|
||||
*/
|
||||
angular.module('passmanApp')
|
||||
.controller('ShareCtrl', ['$scope', 'VaultService', 'CredentialService', 'SettingsService', '$location', '$routeParams', 'ShareService', 'NotificationService', 'SharingACL', 'EncryptService', 'FileService',
|
||||
function ($scope, VaultService, CredentialService, SettingsService, $location, $routeParams, ShareService, NotificationService, SharingACL, EncryptService, FileService) {
|
||||
.controller('ShareCtrl', ['$scope', 'VaultService', 'CredentialService', 'SettingsService', '$location', '$routeParams', 'ShareService', 'NotificationService', 'SharingACL', 'EncryptService',
|
||||
function ($scope, VaultService, CredentialService, SettingsService, $location, $routeParams, ShareService, NotificationService, SharingACL, EncryptService) {
|
||||
$scope.active_vault = VaultService.getActiveVault();
|
||||
|
||||
$scope.tabs = [{
|
||||
|
@ -144,7 +144,6 @@
|
|||
});
|
||||
|
||||
$scope.inputSharedWith = [];
|
||||
$scope.selectedAccessLevel = '1';
|
||||
|
||||
$scope.searchUsers = function ($query) {
|
||||
return ShareService.search($query);
|
||||
|
@ -157,7 +156,7 @@
|
|||
$scope.setPermission = function (acl, permission) {
|
||||
acl.togglePermission(permission);
|
||||
};
|
||||
$scope.shareWith = function (shareWith, selectedAccessLevel) {
|
||||
$scope.shareWith = function (shareWith) {
|
||||
$scope.inputSharedWith = [];
|
||||
if (shareWith.length > 0) {
|
||||
for (var i = 0; i < shareWith.length; i++) {
|
||||
|
@ -203,7 +202,7 @@
|
|||
_credential = CredentialService.encryptCredential(_credential, old_key);
|
||||
CredentialService.updateCredential(_credential, true).then(function () {
|
||||
NotificationService.showNotification('Credential unshared', 4000);
|
||||
CredentialService.reencryptCredential(_credential.guid, old_key, new_key).then(function (data) {
|
||||
CredentialService.reencryptCredential(_credential.guid, old_key, new_key).then(function () {
|
||||
getAcl();
|
||||
});
|
||||
});
|
||||
|
@ -292,7 +291,7 @@
|
|||
var encryptedSharedCredential = angular.copy($scope.storedCredential);
|
||||
var old_key = VaultService.getActiveVault().vaultKey;
|
||||
|
||||
CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function (data) {
|
||||
CredentialService.reencryptCredential(encryptedSharedCredential.guid, old_key, key).progress(function () {
|
||||
}).then(function (data) {
|
||||
var _credential = data.cryptogram;
|
||||
_credential.set_share_key = true;
|
||||
|
@ -336,7 +335,7 @@
|
|||
|
||||
user.accessLevel = angular.copy(user.acl.getAccessLevel());
|
||||
ShareService.shareWithUser(storedCredential, user)
|
||||
.then(function (data) {
|
||||
.then(function () {
|
||||
$scope.share_settings.upload_progress.done++;
|
||||
$scope.share_settings.upload_progress.percent = $scope.share_settings.upload_progress.done / $scope.share_settings.upload_progress.total * 100;
|
||||
});
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
$scope.active_vault.private_sharing_key = EncryptService.encryptString(pem.privateKey);
|
||||
$scope.active_vault.public_sharing_key = pem.publicKey;
|
||||
|
||||
VaultService.updateSharingKeys($scope.active_vault).then(function (result) {
|
||||
VaultService.updateSharingKeys($scope.active_vault).then(function () {
|
||||
$scope.sharing_keys = ShareService.getSharingKeys();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -71,7 +71,6 @@
|
|||
$scope.sharing_keys = {};
|
||||
$scope.newVault = function () {
|
||||
$scope.creating_vault = true;
|
||||
var _vault = {};
|
||||
var key_size = 1024;
|
||||
ShareService.generateRSAKeys(key_size).progress(function (progress) {
|
||||
var p = progress > 0 ? 2 : 1;
|
||||
|
@ -103,7 +102,7 @@
|
|||
|
||||
VaultService.setActiveVault(_vault);
|
||||
try {
|
||||
var c = EncryptService.decryptString(vault.challenge_password);
|
||||
EncryptService.decryptString(vault.challenge_password);
|
||||
if ($scope.remember_vault_password) {
|
||||
SettingsService.setSetting('defaultVaultPass', vault_key);
|
||||
}
|
||||
|
@ -133,10 +132,10 @@
|
|||
test_credential.hidden = true;
|
||||
test_credential.vault_id = vault.vault_id;
|
||||
test_credential.password = 'lorum ipsum';
|
||||
CredentialService.createCredential(test_credential).then(function (result) {
|
||||
CredentialService.createCredential(test_credential).then(function () {
|
||||
_vault.public_sharing_key = angular.copy($scope.sharing_keys.public_sharing_key);
|
||||
_vault.private_sharing_key = EncryptService.encryptString(angular.copy($scope.sharing_keys.private_sharing_key));
|
||||
VaultService.updateSharingKeys(_vault).then(function (result) {
|
||||
VaultService.updateSharingKeys(_vault).then(function () {
|
||||
_loginToVault(vault, vault_key);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
scope: {
|
||||
autoScroll: '='
|
||||
},
|
||||
link: function postLink (scope, element, attrs) {
|
||||
link: function postLink (scope) {
|
||||
scope.$watch('autoScroll', function () {
|
||||
$('#import_log').scrollTop($('#import_log')[0].scrollHeight);
|
||||
}, true);
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
.directive('selectOnClick', ['$window', function ($window) {
|
||||
return {
|
||||
restrict: 'A',
|
||||
link: function (scope, element, attrs) {
|
||||
link: function (scope, element) {
|
||||
element.on('click', function () {
|
||||
if (!$window.getSelection().toString()) {
|
||||
// Required for mobile Safari
|
||||
|
|
|
@ -7,13 +7,13 @@
|
|||
* # passwordGen
|
||||
*/
|
||||
angular.module('passmanApp')
|
||||
.directive('colorFromString', ['$window', function ($window) {
|
||||
.directive('colorFromString', [function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope:{
|
||||
string: '=colorFromString'
|
||||
},
|
||||
link: function (scope, el, attr, ctrl) {
|
||||
link: function (scope, el) {
|
||||
function genColor(str) { // java String#hashCode
|
||||
var hash = 0;
|
||||
for (var i = 0; i < str.length; i++) {
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
'<div class="cell" ng-if="isLink"><a ng-href="{{value}}" target="_blank"><i tooltip="\'Open in new window\'" class="link fa fa-external-link"></i></a></div>' +
|
||||
'<div class="cell" ngclipboard-success="onSuccess(e);" ngclipboard-error="onError(e);" ngclipboard data-clipboard-text="{{value}}"><i tooltip="copy_msg" class="fa fa-clipboard"></i></div>' +
|
||||
'</div></span>',
|
||||
link: function (scope, elem, attrs, modelCtrl) {
|
||||
link: function (scope) {
|
||||
var expression = /(https?:\/\/(?:www\.|(?!www))[^\s\.]+\.[^\s]{2,}|www\.[^\s]+\.[^\s]{2,})/gi;
|
||||
var regex = new RegExp(expression);
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
progress: '&progress'
|
||||
},
|
||||
|
||||
link: function (scope, el, attr, ctrl) {
|
||||
link: function (scope, el) {
|
||||
scope.success = scope.success();
|
||||
scope.error = scope.error();
|
||||
scope.progress = scope.progress();
|
||||
|
@ -44,7 +44,6 @@
|
|||
|
||||
el.bind('change', function (e) {
|
||||
var _queueTotalFileSize = 0;
|
||||
var _queueProgressBytes = 0;
|
||||
var i;
|
||||
//Calcutate total size
|
||||
for (i = 0; i < e.target.files.length; i++) {
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
secret: '='
|
||||
},
|
||||
replace: true,
|
||||
link: function (scope, element) {
|
||||
link: function (scope) {
|
||||
scope.otp = null;
|
||||
scope.timeleft = null;
|
||||
scope.timer = null;
|
||||
|
@ -93,7 +93,7 @@
|
|||
}, true);
|
||||
scope.$on(
|
||||
"$destroy",
|
||||
function (event) {
|
||||
function () {
|
||||
$timeout.cancel(scope.timer);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
*/
|
||||
|
||||
angular.module('passmanApp')
|
||||
.directive('passwordGen', function ($timeout, $window) {
|
||||
.directive('passwordGen', function ($timeout) {
|
||||
/* jshint ignore:start */
|
||||
function Arcfour () {
|
||||
this.j = this.i = 0, this.S = []
|
||||
|
@ -136,7 +136,7 @@
|
|||
"</button>" +
|
||||
"</div>" +
|
||||
"</div>",
|
||||
link: function (scope, elem, attrs, modelCtrl) {
|
||||
link: function (scope) {
|
||||
scope.callback = scope.callback();
|
||||
scope.$watch("model", function () {
|
||||
scope.password = scope.model;
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* # passwordGen
|
||||
*/
|
||||
angular.module('passmanApp')
|
||||
.directive('progressBar', ['$window', function ($window) {
|
||||
.directive('progressBar', [function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
template: '' +
|
||||
|
@ -24,7 +24,7 @@
|
|||
total: '=total'
|
||||
},
|
||||
|
||||
link: function (scope, el, attr, ctrl) {
|
||||
link: function () {
|
||||
|
||||
}
|
||||
};
|
||||
|
|
|
@ -7,12 +7,11 @@
|
|||
* @description
|
||||
* # passwordGen
|
||||
*/
|
||||
angular.module('passmanApp').directive("qrread", ['$parse', '$compile',
|
||||
function ($parse, $compile) {
|
||||
angular.module('passmanApp').directive("qrread", ['$parse',
|
||||
function ($parse) {
|
||||
return {
|
||||
scope: true,
|
||||
link: function (scope, element, attributes) {
|
||||
var gCtx = null, gCanvas = null, c = 0, stype = 0, gUM = false, webkit = false, moz = false;
|
||||
var invoker = $parse(attributes.onRead);
|
||||
scope.imageData = null;
|
||||
|
||||
|
@ -29,7 +28,7 @@
|
|||
element.bind("change", function (changeEvent) {
|
||||
var reader = new FileReader(), file = changeEvent.target.files[0];
|
||||
reader.readAsDataURL(file);
|
||||
reader.onload = (function (theFile) {
|
||||
reader.onload = (function () {
|
||||
return function (e) {
|
||||
//gCtx.clearRect(0, 0, gCanvas.width, gCanvas.height);
|
||||
scope.imageData = e.target.result;
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
* # passwordGen
|
||||
*/
|
||||
angular.module('passmanApp')
|
||||
.directive('tooltip', ['$window', function ($window) {
|
||||
.directive('tooltip', [function () {
|
||||
return {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
tooltip: '=tooltip'
|
||||
},
|
||||
|
||||
link: function (scope, el, attr, ctrl) {
|
||||
scope.$watch('tooltip', function (newVal, old) {
|
||||
link: function (scope, el) {
|
||||
scope.$watch('tooltip', function () {
|
||||
if (scope.tooltip) {
|
||||
jQuery(el).attr('title', scope.tooltip);
|
||||
jQuery(el).tooltip();
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
* # passwordGen
|
||||
*/
|
||||
angular.module('passmanApp')
|
||||
.directive('useTheme', ['$window', function ($window) {
|
||||
.directive('useTheme', [function () {
|
||||
|
||||
function invertColor (hexTripletColor) {
|
||||
var color = hexTripletColor;
|
||||
|
@ -27,7 +27,7 @@
|
|||
color: '=',
|
||||
negative: '='
|
||||
},
|
||||
link: function (scope, el, attr, ctrl) {
|
||||
link: function (scope, el) {
|
||||
var _color = jQuery('#header').css('background-color');
|
||||
var _bg = _color;
|
||||
if (scope.negative) {
|
||||
|
|
|
@ -181,7 +181,7 @@
|
|||
|
||||
// Save data
|
||||
this.parent.new_credential_cryptogram.skip_revision = true;
|
||||
service.updateCredential(this.parent.new_credential_cryptogram, true).then((function (data) {
|
||||
service.updateCredential(this.parent.new_credential_cryptogram, true).then((function () {
|
||||
this.call_progress(new progress_datatype(2, 2, 'credential'));
|
||||
this.call_then({
|
||||
plain_text: this.parent.plain_credential,
|
||||
|
@ -208,7 +208,7 @@
|
|||
|
||||
this.call_progress(new progress_datatype(this.current, this.total, 'files'));
|
||||
|
||||
FileService.updateFile(fileData, this.parent.new_password).then((function (data) {
|
||||
FileService.updateFile(fileData, this.parent.new_password).then((function () {
|
||||
this.current++;
|
||||
this.call_progress(new progress_datatype(this.current, this.total, 'files'));
|
||||
if (this.current === this.total) {
|
||||
|
@ -246,7 +246,7 @@
|
|||
|
||||
this.call_progress(new progress_datatype(this.current + this.upload, this.total, 'revisions'));
|
||||
|
||||
service.updateRevision(_revision).then((function (data) {
|
||||
service.updateRevision(_revision).then((function () {
|
||||
this.upload++;
|
||||
this.call_progress(new progress_datatype(this.upload + this.current, this.total, 'revisions'));
|
||||
if (this.current + this.upload === this.total) {
|
||||
|
@ -298,7 +298,7 @@
|
|||
master_promise.promises++;
|
||||
(new C_Promise(promise_revisions_update, new password_data())).progress(function (data) {
|
||||
master_promise.call_progress(data);
|
||||
}).then(function (data) {
|
||||
}).then(function () {
|
||||
console.warn("End revisions update");
|
||||
master_promise.promises--;
|
||||
if (master_promise.promises === 0) {
|
||||
|
|
|
@ -77,9 +77,6 @@
|
|||
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
|
||||
byteString = atob(dataURI.split(',')[1]);
|
||||
|
||||
// separate out the mime component
|
||||
mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];
|
||||
|
||||
// write the bytes of the string to an ArrayBuffer
|
||||
ab = new ArrayBuffer(byteString.length);
|
||||
ia = new Uint8Array(ab);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
defaultVault: null,
|
||||
defaultVaultPass: null
|
||||
};
|
||||
var neverSend = ['defaultVault', 'defaultVaultPass'];
|
||||
|
||||
|
||||
var cookie = localStorageService.get('settings');
|
||||
settings = angular.merge(settings, cookie);
|
||||
|
|
|
@ -178,7 +178,7 @@
|
|||
return _credential;
|
||||
},
|
||||
|
||||
generateRSAKeys: function (key_length, progress, callback) {
|
||||
generateRSAKeys: function (key_length) {
|
||||
var p = new C_Promise(function () {
|
||||
var state = forge.pki.rsa.createKeyPairGenerationState(key_length, 0x10001);
|
||||
var step = function () {
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
}
|
||||
},
|
||||
removeTag: function (tag) {
|
||||
|
||||
var idx = _tags.indexOf(tag);
|
||||
_tags.splice(idx, 1);
|
||||
}
|
||||
};
|
||||
}]);
|
||||
|
|
|
@ -3,7 +3,7 @@ if(!window['PassmanImporter']){
|
|||
var PassmanImporter = {}
|
||||
}
|
||||
|
||||
PassmanImporter.parseRow_ = function(row, isHeading) {
|
||||
PassmanImporter.parseRow_ = function(row) {
|
||||
// Strip leading quote.
|
||||
row = row.trim();
|
||||
var isQuoted = false;
|
||||
|
|
|
@ -11,7 +11,7 @@ PassmanImporter.clippers = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.clippers.readFile = function (file_data, callback) {
|
||||
PassmanImporter.clippers.readFile = function (file_data) {
|
||||
return new C_Promise(function() {
|
||||
var credential_list = [];
|
||||
var re = /<textarea>(.*?)<\/textarea>/gi;
|
||||
|
|
|
@ -11,12 +11,12 @@ PassmanImporter.dashLaneCsv = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.dashLaneCsv.readFile = function (file_data, callback) {
|
||||
PassmanImporter.dashLaneCsv.readFile = function (file_data) {
|
||||
return new C_Promise(function(){
|
||||
var rows = file_data.split('\n');
|
||||
var credential_list = [];
|
||||
for (var i = 1, row; row = rows[i]; i++) {
|
||||
row = rows[i];
|
||||
for (var i = 0; i < rows.length; i++) {
|
||||
var row = rows[i];
|
||||
var row_data = row.split('","');
|
||||
if (row_data[0].charAt(0) == '"') {
|
||||
row_data[0] = row_data[0].substring(1);
|
||||
|
|
|
@ -11,7 +11,7 @@ PassmanImporter.keepassCsv = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.keepassCsv.readFile = function (file_data, callback) {
|
||||
PassmanImporter.keepassCsv.readFile = function (file_data) {
|
||||
var p = new C_Promise(function(){
|
||||
var parsed_csv = PassmanImporter.readCsv(file_data);
|
||||
var credential_list = [];
|
||||
|
|
|
@ -11,7 +11,7 @@ PassmanImporter.lastpassCsv = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.lastpassCsv.readFile = function (file_data, callback) {
|
||||
PassmanImporter.lastpassCsv.readFile = function (file_data) {
|
||||
return new C_Promise(function(){
|
||||
var parsed_csv = PassmanImporter.readCsv(file_data);
|
||||
var credential_list = [];
|
||||
|
|
|
@ -11,7 +11,7 @@ PassmanImporter.passmanJson = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.passmanJson.readFile = function (file_data, callback) {
|
||||
PassmanImporter.passmanJson.readFile = function (file_data) {
|
||||
return new C_Promise(function(){
|
||||
var parsed_json = PassmanImporter.readJson(file_data);
|
||||
var credential_list = [];
|
||||
|
|
|
@ -11,7 +11,7 @@ PassmanImporter.passpackCsv = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.passpackCsv.readFile = function (file_data, callback) {
|
||||
PassmanImporter.passpackCsv.readFile = function (file_data) {
|
||||
return new C_Promise(function(){
|
||||
var parsed_csv = PassmanImporter.readCsv(file_data, false);
|
||||
var credential_list = [];
|
||||
|
|
|
@ -11,7 +11,7 @@ PassmanImporter.randomData = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.randomData.readFile = function (file_data, callback) {
|
||||
PassmanImporter.randomData.readFile = function () {
|
||||
return new C_Promise(function () {
|
||||
var tags =
|
||||
['Social media',
|
||||
|
|
|
@ -11,7 +11,7 @@ PassmanImporter.zohoCsv = {
|
|||
}
|
||||
};
|
||||
|
||||
PassmanImporter.zohoCsv.readFile = function (file_data, callback) {
|
||||
PassmanImporter.zohoCsv.readFile = function (file_data) {
|
||||
return new C_Promise(function(){
|
||||
var parsed_csv = PassmanImporter.readCsv(file_data, false);
|
||||
var credential_list = [];
|
||||
|
|
|
@ -241,7 +241,7 @@ class Activity implements \OCP\Activity\IExtension {
|
|||
array(
|
||||
'id' => 'passman',
|
||||
'name' => (string) $l->t('Passwords'),
|
||||
'url' => '',//FIXME: $this->URLGenerator->linkToRoute('activity.Activities.showList', array('filter' => 'passman')),
|
||||
'url' => '',//FIXME: Currenlty we cannot link directly to links, so this needs to be fixed... this->URLGenerator->linkToRoute('activity.Activities.showList', array('filter' => 'passman')),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -32,7 +32,6 @@ class Application extends App {
|
|||
public function __construct () {
|
||||
parent::__construct('passman');
|
||||
$container = $this->getContainer();
|
||||
$server = $container->getServer();
|
||||
// Allow automatic DI for the View, until we migrated to Nodes API
|
||||
$container->registerService(View::class, function() {
|
||||
return new View('');
|
||||
|
|
|
@ -60,7 +60,7 @@ class Notifier implements INotifier {
|
|||
$notification->addParsedAction($action);
|
||||
}
|
||||
return $notification;
|
||||
break;
|
||||
|
||||
|
||||
case 'credential_shared':
|
||||
$notification->setParsedSubject(
|
||||
|
@ -80,21 +80,18 @@ class Notifier implements INotifier {
|
|||
$notification->addParsedAction($action);
|
||||
}
|
||||
return $notification;
|
||||
break;
|
||||
|
||||
case 'credential_share_denied':
|
||||
$notification->setParsedSubject(
|
||||
(string) $l->t('%s has declined your share request for "%s".', $notification->getSubjectParameters())
|
||||
);
|
||||
return $notification;
|
||||
break;
|
||||
|
||||
case 'credential_share_accepted':
|
||||
$notification->setParsedSubject(
|
||||
(string) $l->t('%s has accepted your share request for "%s".', $notification->getSubjectParameters())
|
||||
);
|
||||
return $notification;
|
||||
break;
|
||||
default:
|
||||
// Unknown subject => Unknown notification => throw
|
||||
throw new \InvalidArgumentException();
|
||||
|
|
|
@ -21,7 +21,7 @@ class NotificationService {
|
|||
|
||||
private $manager;
|
||||
|
||||
public function __construct(FileMapper $fileMapper) {
|
||||
public function __construct() {
|
||||
$this->manager = \OC::$server->getNotificationManager();
|
||||
}
|
||||
|
||||
|
@ -41,8 +41,8 @@ class NotificationService {
|
|||
$notification->setApp('passman')
|
||||
->setUser($credential->getUserId())
|
||||
->setDateTime(new \DateTime())
|
||||
->setObject('credential', $credential->getId()) // $type and $id
|
||||
->setSubject('credential_expired', [$credential->getLabel()]) // $subject and $parameters
|
||||
->setObject('credential', $credential->getId()) // Set notification type and id
|
||||
->setSubject('credential_expired', [$credential->getLabel()]) // set subject and parameters
|
||||
->setLink($link)
|
||||
->addAction($declineAction)
|
||||
->addAction($remindAction);
|
||||
|
@ -64,8 +64,8 @@ class NotificationService {
|
|||
$notification->setApp('passman')
|
||||
->setUser($data['target_user'])
|
||||
->setDateTime(new \DateTime())
|
||||
->setObject('passman_share_request', $data['req_id']) // $type and $id
|
||||
->setSubject('credential_shared', [$data['from_user'], $data['credential_label']]) // $subject and $parameters
|
||||
->setObject('passman_share_request', $data['req_id']) // type and id
|
||||
->setSubject('credential_shared', [$data['from_user'], $data['credential_label']]) // subject and parameters
|
||||
->setLink($link)
|
||||
->addAction($declineAction);
|
||||
|
||||
|
@ -78,8 +78,8 @@ class NotificationService {
|
|||
$notification->setApp('passman')
|
||||
->setUser($data['target_user'])
|
||||
->setDateTime(new \DateTime())
|
||||
->setObject('passman_share_request', $data['req_id']) // $type and $id
|
||||
->setSubject('credential_share_denied', [$data['from_user'], $data['credential_label']]); // $subject and $parameters
|
||||
->setObject('passman_share_request', $data['req_id']) // type and id
|
||||
->setSubject('credential_share_denied', [$data['from_user'], $data['credential_label']]); // subject and parameters
|
||||
$this->manager->notify($notification);
|
||||
}
|
||||
|
||||
|
@ -89,8 +89,8 @@ class NotificationService {
|
|||
$notification->setApp('passman')
|
||||
->setUser($data['target_user'])
|
||||
->setDateTime(new \DateTime())
|
||||
->setObject('passman_share_request', $data['req_id']) // $type and $id
|
||||
->setSubject('credential_share_accepted', [$data['from_user'], $data['credential_label']]); // $subject and $parameters
|
||||
->setObject('passman_share_request', $data['req_id']) // type and id
|
||||
->setSubject('credential_share_accepted', [$data['from_user'], $data['credential_label']]); // subject and parameters
|
||||
$this->manager->notify($notification);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue