diff --git a/src/app/services/cipherService.js b/src/app/services/cipherService.js index 786a7f0e6e..0cdf2de44f 100644 --- a/src/app/services/cipherService.js +++ b/src/app/services/cipherService.js @@ -1,8 +1,10 @@ angular .module('bit.services') - .factory('cipherService', function (cryptoService, apiService, $q, $window, constants, appSettings) { - var _service = {}; + .factory('cipherService', function (cryptoService, apiService, $q, $window, constants, appSettings, $localStorage) { + var _service = { + disableWebsiteIcons: $localStorage.disableWebsiteIcons + }; _service.decryptCiphers = function (encryptedCiphers) { if (!encryptedCiphers) throw "encryptedCiphers is undefined or null"; @@ -187,7 +189,7 @@ angular }; function setLoginIcon(cipher, uri, setImage) { - if (!appSettings.selfHosted && uri) { + if (!appSettings.selfHosted && !_service.disableWebsiteIcons && uri) { var hostnameUri = uri, isWebsite = false; diff --git a/src/app/settings/settingsController.js b/src/app/settings/settingsController.js index 330ea42600..1fe8d93917 100644 --- a/src/app/settings/settingsController.js +++ b/src/app/settings/settingsController.js @@ -1,11 +1,13 @@ angular .module('bit.settings') - .controller('settingsController', function ($scope, $state, $uibModal, apiService, toastr, authService) { + .controller('settingsController', function ($scope, $state, $uibModal, apiService, toastr, authService, $localStorage, + appSettings, $rootScope, cipherService) { + $scope.selfHosted = appSettings.selfHosted; $scope.model = { profile: {}, - twoFactorEnabled: false, - email: null + email: null, + disableWebsiteIcons: false }; $scope.$on('$viewContentLoaded', function () { @@ -17,7 +19,7 @@ culture: user.Culture }, email: user.Email, - twoFactorEnabled: user.TwoFactorEnabled + disableWebsiteIcons: $localStorage.disableWebsiteIcons }; if (user.Organizations) { @@ -58,6 +60,15 @@ }).$promise; }; + $scope.optionsSave = function () { + if (!$scope.selfHosted) { + $localStorage.disableWebsiteIcons = cipherService.disableWebsiteIcons = $scope.model.disableWebsiteIcons; + $rootScope.vaultCiphers = null; + } + + toastr.success('Options have been updated.', 'Success!'); + }; + $scope.changePassword = function () { $uibModal.open({ animation: true, diff --git a/src/app/settings/views/settings.html b/src/app/settings/views/settings.html index ca1a05ba73..9d647e9c93 100644 --- a/src/app/settings/views/settings.html +++ b/src/app/settings/views/settings.html @@ -86,6 +86,27 @@ +
+
+

Options

+
+
+
+
+ +

Website Icons provide a recognizable image next to each login item in your vault.

+
+
+ +
+

Organizations