diff --git a/appinfo/database.xml b/appinfo/database.xml index 0536c2ac..8837da82 100644 --- a/appinfo/database.xml +++ b/appinfo/database.xml @@ -36,7 +36,11 @@ 100 true - + + vault_settings + clob + false + created integer diff --git a/appinfo/info.xml b/appinfo/info.xml index ac6ea8e1..bf63a5a1 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -5,7 +5,7 @@ A password manager for Nextcloud AGPL Sander Brand - 1.0.2.9 + 1.0.2.11 Passman other https://github.com/nextcloud/passman/ diff --git a/controller/vaultcontroller.php b/controller/vaultcontroller.php index 6ef5db83..d6009b18 100644 --- a/controller/vaultcontroller.php +++ b/controller/vaultcontroller.php @@ -56,15 +56,40 @@ class VaultController extends ApiController { */ public function get($vault_id) { $credentials = $this->credentialService->getCredentialsByVaultId($vault_id, $this->userId); - $this->vaultService->setLastAccess($vault_id); - return new JSONResponse($credentials); + $vault = $this->vaultService->getById($vault_id, $this->userId); + $vault = $vault[0]; + if($vault) { + $result = array( + 'vault_id' => $vault->getId(), + 'guid' => $vault->getGuid(), + 'name' => $vault->getName(), + 'created' => $vault->getCreated(), + 'private_sharing_key' => $vault->getPrivateSharingKey(), + 'public_sharing_key' => $vault->getPublicSharingKey(), + 'sharing_keys_generated' => $vault->getSharingKeysGenerated(), + 'vault_settings' => $vault->getVaultSettings(), + 'last_access' => $vault->getlastAccess() + ); + $result['credentials'] = $credentials; + $this->vaultService->setLastAccess($vault_id, $this->userId); + } else { + $result = array(); + } + return new JSONResponse($result); } /** * @NoAdminRequired */ - public function update($vault_id) { - return; + public function update($vault_id, $name, $vault_settings) { + $vault = array_pop($this->vaultService->getById($vault_id, $this->userId)); + if($name) { + $vault->setName($name); + } + if($vault_settings) { + $vault->setVaultSettings($vault_settings); + } + $this->vaultService->updateVault($vault); } /** diff --git a/js/app/controllers/credential.js b/js/app/controllers/credential.js index 33e6615a..bbf7b111 100644 --- a/js/app/controllers/credential.js +++ b/js/app/controllers/credential.js @@ -27,6 +27,42 @@ angular.module('passmanApp') } + + $scope.show_spinner = true; + + + var fetchCredentials = function () { + VaultService.getVault($scope.active_vault).then(function (vault) { + $scope.active_vault = angular.merge($scope.active_vault, vault); + var _credentials = []; + for (var i = 0; i < $scope.active_vault.credentials.length; i++) { + try { + $scope.active_vault.credentials[i] = CredentialService.decryptCredential(angular.copy(vault.credentials[i])); + $scope.active_vault.credentials[i].tags_raw = $scope.active_vault.credentials[i].tags; + } catch (e) { + NotificationService.showNotification('An error happend during decryption', 5000); + $rootScope.$broadcast('logout'); + SettingsService.setSetting('defaultVaultPass', null); + SettingsService.setSetting('defaultVault', null); + $location.path('/') + + } + if ($scope.active_vault.credentials[i]) { + TagService.addTags($scope.active_vault.credentials[i].tags); + + } + } + $scope.show_spinner = false; + }); + }; + + if ($scope.active_vault) { + $scope.$parent.selectedVault = true; + fetchCredentials(); + } + + + $scope.addCredential = function () { var new_credential = CredentialService.newCredential(); var enc_c = CredentialService.encryptCredential(new_credential); @@ -201,40 +237,6 @@ angular.module('passmanApp') }); - $scope.show_spinner = true; - - - var fetchCredentials = function () { - VaultService.getVault($scope.active_vault).then(function (credentials) { - var _credentials = []; - for (var i = 0; i < credentials.length; i++) { - try { - var _c = CredentialService.decryptCredential(angular.copy(credentials[i])); - } catch (e) { - NotificationService.showNotification('An error happend during decryption', 5000); - $rootScope.$broadcast('logout'); - SettingsService.setSetting('defaultVaultPass', null); - SettingsService.setSetting('defaultVault', null); - $location.path('/') - - } - if (_c) { - _c.tags_raw = _c.tags; - TagService.addTags(_c.tags); - _credentials.push(_c); - } - } - $scope.credentials = _credentials; - $scope.show_spinner = false; - - }); - }; - - if ($scope.active_vault) { - $scope.$parent.selectedVault = true; - fetchCredentials(); - } - $scope.downloadFile = function (file) { FileService.getFile(file).then(function (result) { diff --git a/js/app/controllers/edit_credential.js b/js/app/controllers/edit_credential.js index cf08a249..fe248fc4 100644 --- a/js/app/controllers/edit_credential.js +++ b/js/app/controllers/edit_credential.js @@ -10,8 +10,33 @@ angular.module('passmanApp') .controller('CredentialEditCtrl', ['$scope', 'VaultService', 'CredentialService', 'SettingsService', '$location', '$routeParams', 'FileService', 'EncryptService', 'TagService', 'NotificationService', function ($scope, VaultService, CredentialService, SettingsService, $location, $routeParams, FileService, EncryptService, TagService, NotificationService) { - $scope.active_vault = VaultService.getActiveVault(); + if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { + if (!$scope.active_vault) { + $location.path('/') + } + } else { + if (SettingsService.getSetting('defaultVault') && SettingsService.getSetting('defaultVaultPass')) { + var _vault = angular.copy(SettingsService.getSetting('defaultVault')); + VaultService.getVault(_vault).then(function (vault) { + vault.vaultKey = SettingsService.getSetting('defaultVaultPass'); + VaultService.setActiveVault(vault); + $scope.active_vault = vault; + $scope.pwSettings = VaultService.getVaultSetting('pwSettings', + { + 'length': 12, + 'useUppercase': true, + 'useLowercase': true, + 'useDigits': true, + 'useSpecialChars': true, + 'minimumDigitCount': 3, + 'avoidAmbiguousCharacters': false, + 'requireEveryCharType': true, + 'generateOnCreate': true, + }) + }) + } + } $scope.tabs = [{ title: 'General', @@ -35,16 +60,6 @@ angular.module('passmanApp') color: 'purple' }]; - $scope.pwSettings = { - 'length': 12, - 'useUppercase': true, - 'useLowercase': true, - 'useDigits': true, - 'useSpecialChars': true, - 'minimumDigitCount': 3, - 'avoidAmbiguousCharacters': false, - 'requireEveryCharType': true - }; if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { if (!$scope.active_vault) { @@ -65,7 +80,7 @@ angular.module('passmanApp') var storedCredential = SettingsService.getSetting('edit_credential'); if (!storedCredential) { - CredentialService.getCredential($routeParams.credential_id).then(function(result){ + CredentialService.getCredential($routeParams.credential_id).then(function (result) { $scope.storedCredential = CredentialService.decryptCredential(angular.copy(result)); }); } else { @@ -171,10 +186,10 @@ angular.module('passmanApp') $scope.renewIntervalValue = 0; $scope.renewIntervalModifier = '0'; - $scope.updateInterval = function(renewIntervalValue, renewIntervalModifier){ + $scope.updateInterval = function (renewIntervalValue, renewIntervalModifier) { var value = parseInt(renewIntervalValue); var modifier = parseInt(renewIntervalModifier); - if( value && modifier) { + if (value && modifier) { $scope.storedCredential.renew_interval = value * modifier; } }; diff --git a/js/app/controllers/settings.js b/js/app/controllers/settings.js index 1d86ac24..288bc34f 100644 --- a/js/app/controllers/settings.js +++ b/js/app/controllers/settings.js @@ -8,18 +8,61 @@ * Controller of the passmanApp */ angular.module('passmanApp') - .controller('SettingsCtrl', ['$scope', '$rootScope', 'SettingsService', 'VaultService', 'CredentialService', '$location', '$routeParams', '$http', - function ($scope, $rootScope, SettingsService, VaultService, CredentialService, $location, $routeParams, $http) { - $scope.active_vault = VaultService.getActiveVault(); + .controller('SettingsCtrl', ['$scope', '$rootScope', 'SettingsService', 'VaultService', 'CredentialService', '$location', '$routeParams', '$http', 'EncryptService', + function ($scope, $rootScope, SettingsService, VaultService, CredentialService, $location, $routeParams, $http, EncryptService) { + $scope.vault_settings = {}; + if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { + if (!$scope.active_vault) { + $location.path('/') + } + } else { + if (SettingsService.getSetting('defaultVault') && SettingsService.getSetting('defaultVaultPass')) { + var _vault = angular.copy(SettingsService.getSetting('defaultVault')); + VaultService.getVault(_vault).then(function (vault) { + vault.vaultKey = SettingsService.getSetting('defaultVaultPass'); + VaultService.setActiveVault(vault); + $scope.active_vault = vault; + $scope.$parent.selectedVault = true; + $scope.vault_settings.pwSettings = VaultService.getVaultSetting('pwSettings', + { + 'length': 12, + 'useUppercase': true, + 'useLowercase': true, + 'useDigits': true, + 'useSpecialChars': true, + 'minimumDigitCount': 3, + 'avoidAmbiguousCharacters': false, + 'requireEveryCharType': true, + 'generateOnCreate': true, + }) + }) + } + } + + + $scope.saveVaultSettings = function () { + var _vault = $scope.active_vault; + _vault.vault_settings = angular.copy($scope.vault_settings); + VaultService.updateVault(_vault).then(function () { + VaultService.setActiveVault(_vault); + }); + }; + + $scope.tabs = [ { title: 'General settings', url: 'views/partials/forms/settings/general_settings.html' }, { - title: 'Password Tool', + title: 'Password Audit', url: 'views/partials/forms/settings/tool.html' + }, + { + title: 'Password settings', + url: 'views/partials/forms/settings/password_settings.html' + }, { title: 'Import credentials', @@ -33,7 +76,7 @@ angular.module('passmanApp') }, { title: 'Sharing', - url:'views/partials/forms/settings/sharing.html' + url: 'views/partials/forms/settings/sharing.html' } ]; @@ -58,47 +101,37 @@ angular.module('passmanApp') $scope.$watch(function () { return VaultService.getActiveVault() }, function (vault) { - if(vault) { + if (vault) { $scope.active_vault = vault; } }); - if (!SettingsService.getSetting('defaultVault') || !SettingsService.getSetting('defaultVaultPass')) { - if (!$scope.active_vault) { - $location.path('/') - } - } else { - if (SettingsService.getSetting('defaultVault') && SettingsService.getSetting('defaultVaultPass')) { - var _vault = angular.copy(SettingsService.getSetting('defaultVault')); - _vault.vaultKey = angular.copy(SettingsService.getSetting('defaultVaultPass')); - VaultService.setActiveVault(_vault); - $scope.active_vault = _vault; - - } - } if ($scope.active_vault) { - $scope.$parent.selectedVault = true; + } $rootScope.$on('logout', function () { $scope.selectedVault = false; }); - $scope.startScan = function (minStrength) { - VaultService.getVault($scope.active_vault).then(function (credentials) { + VaultService.getVault($scope.active_vault).then(function (vault) { var results = []; - for (var i = 0; i < credentials.length; i++) { - var c = CredentialService.decryptCredential(angular.copy(credentials[i])); - if (c.password && c.password.length > 0 && c.hidden == 0) { - var zxcvbn_result = zxcvbn(c.password); - if (zxcvbn_result.score <= minStrength) { - results.push({ - credential_id: c.credential_id, - label: c.label, - password: c.password, - password_zxcvbn_result: zxcvbn_result - }); + for (var i = 0; i < vault.credentials.length; i++) { + var c = angular.copy(vault.credentials[i]); + if (c.password && c.hidden == 0) { + c = CredentialService.decryptCredential(c); + if(c.password){ + var zxcvbn_result = zxcvbn(c.password); + if (zxcvbn_result.score <= minStrength) { + results.push({ + credential_id: c.credential_id, + label: c.label, + password: c.password, + password_zxcvbn_result: zxcvbn_result + }); + } } + } //@todo loop custom fields (if any and check secret fields } @@ -108,7 +141,6 @@ angular.module('passmanApp') $scope.cancel = function () { $location.path('/vault/' + $routeParams.vault_id); - }; }]); diff --git a/js/app/controllers/vault.js b/js/app/controllers/vault.js index 0acb69c7..6b0d44fe 100644 --- a/js/app/controllers/vault.js +++ b/js/app/controllers/vault.js @@ -99,8 +99,8 @@ angular.module('passmanApp') var _vault = angular.copy(vault); _vault.vaultKey = angular.copy(vault_key); VaultService.setActiveVault(_vault); - VaultService.getVault(vault).then(function (credentials) { - var credential = credentials[0]; + VaultService.getVault(vault).then(function (vault) { + var credential = vault.credentials[0]; try { var c = CredentialService.decryptCredential(credential); if ($scope.remember_vault_password) { diff --git a/js/app/directives/passwordgen.js b/js/app/directives/passwordgen.js index a680f23c..1e3af42e 100644 --- a/js/app/directives/passwordgen.js +++ b/js/app/directives/passwordgen.js @@ -133,14 +133,18 @@ angular.module('passmanApp') }; scope.passwordNotNull = false; + scope.$watch("settings", function () { + if(scope.settings) { + if (!scope.password && scope.settings.generateOnCreate) { + scope.generatePasswordStart(); + } + } + }); + + scope.$watch("password", function () { scope.model = scope.password; scope.password_repeat = scope.model; - - if(!scope.password) { - console.log('Generating new pw'); - scope.generatePasswordStart(); - } }); // scope.onSuccess = function(e) { diff --git a/js/app/services/encryptservice.js b/js/app/services/encryptservice.js index 4c67cec9..2b35ec0d 100644 --- a/js/app/services/encryptservice.js +++ b/js/app/services/encryptservice.js @@ -34,6 +34,7 @@ angular.module('passmanApp') } catch(e) { throw e; } - } + }, + } }]); diff --git a/js/app/services/vaultservice.js b/js/app/services/vaultservice.js index b546a71d..3d315809 100644 --- a/js/app/services/vaultservice.js +++ b/js/app/services/vaultservice.js @@ -10,8 +10,9 @@ angular.module('passmanApp') .service('VaultService', ['$http', function ($http) { // AngularJS will instantiate a singleton by calling "new" on this function + var _this = this; var _activeVault; - return { + var service = { getVaults: function(){ var queryUrl = OC.generateUrl('apps/passman/api/v2/vaults'); return $http.get(queryUrl).then(function (response) { @@ -23,18 +24,28 @@ angular.module('passmanApp') }); }, setActiveVault: function(vault){ - this.getVaults().then(function(vaults){ - for(var v = 0; v < vaults.length; v++){ - if(vaults[v].vault_id == vault.vault_id){ - _activeVault = angular.merge(_activeVault, vaults[v]); - } - } - }); - _activeVault = vault; + _activeVault = angular.copy(vault); }, getActiveVault: function(vault){ return _activeVault; }, + getVaultSetting: function(key, default_value){ + if(!_activeVault.vault_settings){ + return default_value + } else { + return (_activeVault.vault_settings[key] !== undefined) ? _activeVault.vault_settings[key] : default_value + } + + }, + setVaultSetting: function(key, value){ + if(!_activeVault.vault_settings){ + return false; + } else { + _activeVault.vault_settings[key] = value; + _this.updateVault(_activeVault); + } + + }, createVault: function (vaultName) { var queryUrl = OC.generateUrl('apps/passman/api/v2/vaults'); return $http.post(queryUrl, { vault_name: vaultName }).then(function (response) { @@ -49,6 +60,11 @@ angular.module('passmanApp') var queryUrl = OC.generateUrl('apps/passman/api/v2/vaults/' + vault.vault_id); return $http.get(queryUrl).then(function (response) { if(response.data){ + if(response.data.vault_settings){ + response.data.vault_settings = JSON.parse(window.atob(response.data.vault_settings)) + } else { + response.data.vault_settings = {}; + } return response.data; } else { return response; @@ -56,8 +72,12 @@ angular.module('passmanApp') }); }, updateVault: function (vault) { - var queryUrl = OC.generateUrl('apps/passman/api/v2/vaults/' + vault.vault_id); - return $http.post(queryUrl).then(function (response) { + var _vault = angular.copy(vault); + delete vault.defaultVaultPass; + delete vault.defaultVault; + _vault.vault_settings = window.btoa(JSON.stringify(_vault.vault_settings)) + var queryUrl = OC.generateUrl('apps/passman/api/v2/vaults/' + _vault.vault_id); + return $http.patch(queryUrl, _vault).then(function (response) { if(response.data){ return response.data; } else { @@ -85,5 +105,7 @@ angular.module('passmanApp') } }); } - } + }; + + return service; }]); diff --git a/js/templates.js b/js/templates.js index 9ae56e76..c359f422 100644 --- a/js/templates.js +++ b/js/templates.js @@ -1,4 +1,4 @@ -angular.module('templates-main', ['views/credential_revisions.html', 'views/edit_credential.html', 'views/partials/forms/edit_credential/basics.html', 'views/partials/forms/edit_credential/custom_fields.html', 'views/partials/forms/edit_credential/files.html', 'views/partials/forms/edit_credential/otp.html', 'views/partials/forms/edit_credential/password.html', 'views/partials/forms/settings/export.html', 'views/partials/forms/settings/general_settings.html', 'views/partials/forms/settings/import.html', 'views/partials/forms/settings/sharing.html', 'views/partials/forms/settings/tool.html', 'views/partials/forms/share_credential/basics.html', 'views/partials/forms/share_credential/expire_settings.html', 'views/partials/password-meter.html', 'views/settings.html', 'views/share_credential.html', 'views/show_vault.html', 'views/vaults.html']); +angular.module('templates-main', ['views/credential_revisions.html', 'views/edit_credential.html', 'views/partials/forms/edit_credential/basics.html', 'views/partials/forms/edit_credential/custom_fields.html', 'views/partials/forms/edit_credential/files.html', 'views/partials/forms/edit_credential/otp.html', 'views/partials/forms/edit_credential/password.html', 'views/partials/forms/settings/export.html', 'views/partials/forms/settings/general_settings.html', 'views/partials/forms/settings/import.html', 'views/partials/forms/settings/password_settings.html', 'views/partials/forms/settings/sharing.html', 'views/partials/forms/settings/tool.html', 'views/partials/forms/share_credential/basics.html', 'views/partials/forms/share_credential/expire_settings.html', 'views/partials/password-meter.html', 'views/settings.html', 'views/share_credential.html', 'views/show_vault.html', 'views/vaults.html']); angular.module('views/credential_revisions.html', []).run(['$templateCache', function($templateCache) { 'use strict'; @@ -60,6 +60,12 @@ angular.module('views/partials/forms/settings/import.html', []).run(['$templateC '
{{selectedImporter.description}}

Read progress
{{ file_read_progress.loaded }} / {{ file_read_progress.total }}
Upload progress
{{ import_progress.loaded }} / {{ import_progress.total }}
'); }]); +angular.module('views/partials/forms/settings/password_settings.html', []).run(['$templateCache', function($templateCache) { + 'use strict'; + $templateCache.put('views/partials/forms/settings/password_settings.html', + '
'); +}]); + angular.module('views/partials/forms/settings/sharing.html', []).run(['$templateCache', function($templateCache) { 'use strict'; $templateCache.put('views/partials/forms/settings/sharing.html', @@ -107,7 +113,7 @@ angular.module('views/share_credential.html', []).run(['$templateCache', functio angular.module('views/show_vault.html', []).run(['$templateCache', function($templateCache) { 'use strict'; $templateCache.put('views/show_vault.html', - '
Showing deleted since: All time {{delete_time | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
+
{{credential.label}} {{tag.text}}
  • {{credential.label}}
    {{tag.text}}
Label{{selectedCredential.label}}
Account
Password
OTP
E-mail
URL
Files
{{field.label}}
Expire time{{selectedCredential.expire_time * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
Changed{{selectedCredential.changed * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
Created{{selectedCredential.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
{{tag.text}}
'); + '
Showing deleted since: All time {{delete_time | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
+
{{credential.label}} {{tag.text}}
  • {{credential.label}}
    {{tag.text}}
Label{{selectedCredential.label}}
Account
Password
OTP
E-mail
URL
Files
{{field.label}}
Expire time{{selectedCredential.expire_time * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
Changed{{selectedCredential.changed * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
Created{{selectedCredential.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}
{{tag.text}}
'); }]); angular.module('views/vaults.html', []).run(['$templateCache', function($templateCache) { diff --git a/lib/Db/Vault.php b/lib/Db/Vault.php index 4a43ff11..c840cdea 100644 --- a/lib/Db/Vault.php +++ b/lib/Db/Vault.php @@ -31,6 +31,8 @@ use \OCP\AppFramework\Db\Entity; * @method string getPrivateSharingKey() * @method void setSharingKeysGenerated(integer $value) * @method integer getSharingKeysGenerated() + * @method void setVaultSettings(integer $value) + * @method integer getVaultSettings() */ @@ -46,11 +48,13 @@ class Vault extends Entity implements \JsonSerializable{ protected $publicSharingKey; protected $privateSharingKey; protected $sharingKeysGenerated; + protected $vaultSettings; + public function __construct() { // add types in constructor $this->addType('created', 'integer'); $this->addType('lastAccess', 'integer'); - $this->addType('sharing_keys_generated', 'integer'); + $this->addType('sharingKeysGenerated', 'integer'); } /** * Turns entity attributes into an array @@ -61,9 +65,7 @@ class Vault extends Entity implements \JsonSerializable{ 'guid' => $this->getGuid(), 'name' => $this->getName(), 'created' => $this->getCreated(), - 'private_sharing_key' => $this->getPrivateSharingKey(), 'public_sharing_key' => $this->getPublicSharingKey(), - 'sharing_keys_generated' => $this->getSharingKeysGenerated(), 'last_access' => $this->getlastAccess(), ]; } diff --git a/lib/Db/VaultMapper.php b/lib/Db/VaultMapper.php index 0eadd459..b804a054 100644 --- a/lib/Db/VaultMapper.php +++ b/lib/Db/VaultMapper.php @@ -26,12 +26,13 @@ class VaultMapper extends Mapper { * @throws \OCP\AppFramework\Db\DoesNotExistException if not found * @throws \OCP\AppFramework\Db\MultipleObjectsReturnedException if more than one result */ - public function find($vault_id) { + public function find($vault_id, $user_id) { $sql = 'SELECT * FROM `*PREFIX*passman_vaults` ' . - 'WHERE `user_id` = ?'; - return $this->findEntities($sql, [$vault_id]); + 'WHERE `id`= ? and `user_id` = ?'; + return $this->findEntities($sql, [$vault_id, $user_id]); } + public function findVaultsFromUser($userId){ $sql = 'SELECT * FROM `*PREFIX*passman_vaults` ' . 'WHERE `user_id` = ? '; @@ -45,14 +46,19 @@ class VaultMapper extends Mapper { $vault->setUserId($userId); $vault->setGuid($this->utils->GUID()); $vault->setCreated($this->utils->getTime()); - $vault->setlastAccess(0); + $vault->setLastAccess(0); return parent::insert($vault); } - public function setLastAccess($vault_id){ + public function setLastAccess($vault_id, $user_id){ $vault = new Vault(); $vault->setId($vault_id); - $vault->setlastAccess(time()); + $vault->setUserId($user_id); + $vault->setLastAccess(time()); + $this->update($vault); + } + + public function updateVault(Vault $vault){ $this->update($vault); } diff --git a/lib/Service/VaultService.php b/lib/Service/VaultService.php index 26916b05..a8b365c4 100644 --- a/lib/Service/VaultService.php +++ b/lib/Service/VaultService.php @@ -29,12 +29,21 @@ class VaultService { return $this->vaultMapper->findVaultsFromUser($userId); } + public function getById($vault_id, $user_id) { + $vault = $this->vaultMapper->find($vault_id, $user_id); + return $vault; + } + public function createVault($vault_name, $userId) { return $this->vaultMapper->create($vault_name, $userId); } - public function setLastAccess($vault_id){ - return $this->vaultMapper->setLastAccess($vault_id); + public function updateVault($vault) { + return $this->vaultMapper->updateVault($vault); + } + + public function setLastAccess($vault_id, $user_id){ + return $this->vaultMapper->setLastAccess($vault_id, $user_id); } public function updateSharingKeys($vault_id, $privateKey, $publicKey){ diff --git a/templates/views/partials/forms/settings/password_settings.html b/templates/views/partials/forms/settings/password_settings.html new file mode 100644 index 00000000..8666fb35 --- /dev/null +++ b/templates/views/partials/forms/settings/password_settings.html @@ -0,0 +1,57 @@ +
+
+ + + +
+
+ + + + + + +
+
+
+
+ +
+
\ No newline at end of file diff --git a/templates/views/show_vault.html b/templates/views/show_vault.html index 0fad02df..e90e52bc 100644 --- a/templates/views/show_vault.html +++ b/templates/views/show_vault.html @@ -61,7 +61,7 @@
- @@ -76,7 +76,7 @@