diff options
author | brantje <brantje@gmail.com> | 2017-01-09 16:04:30 +0300 |
---|---|---|
committer | brantje <brantje@gmail.com> | 2017-01-09 16:04:30 +0300 |
commit | 0a81cb88ad2865640a7fbca6ef546bd04a08e2ff (patch) | |
tree | f36f721af293e2a322b0a4d029da9e34284a03e4 | |
parent | 77b412a839ea7b45e8f8b3dbe0a035b4d495ae1d (diff) | |
parent | 8c82b795e2e096cb0f2b1403f21f3d12b56ab340 (diff) |
Merge branch 'vaultTimer'
-rw-r--r-- | controller/translationcontroller.php | 4 | ||||
-rw-r--r-- | css/app.css | 2 | ||||
-rw-r--r-- | js/app/controllers/main.js | 26 | ||||
-rw-r--r-- | js/app/controllers/vault.js | 16 | ||||
-rw-r--r-- | js/app/filters/toHHMMSS.js | 47 | ||||
-rw-r--r-- | js/templates.js | 4 | ||||
-rw-r--r-- | sass/app.scss | 2 | ||||
-rw-r--r-- | templates/main.php | 9 | ||||
-rw-r--r-- | templates/views/show_vault.html | 2 | ||||
-rw-r--r-- | templates/views/vaults.html | 16 |
10 files changed, 119 insertions, 9 deletions
diff --git a/controller/translationcontroller.php b/controller/translationcontroller.php index a60e6abd..a944c887 100644 --- a/controller/translationcontroller.php +++ b/controller/translationcontroller.php @@ -304,7 +304,7 @@ class TranslationController extends ApiController { 'revisions' => $this->trans->t('Revisions'), 'recover' => $this->trans->t('Recover'), 'destroy' => $this->trans->t('Destroy'), - + 'use.regex' => $this->trans->t('Use regex'), 'sharereq.title' => $this->trans->t('You have incoming share requests.'), 'sharereq.line1' => $this->trans->t('If you want to put the credential in a other vault,'), 'sharereq.line2' => $this->trans->t('logout of this vault and login to the vault you want the shared credential in.'), @@ -313,6 +313,7 @@ class TranslationController extends ApiController { 'date' => $this->trans->t('Date'), 'accept' => $this->trans->t('Accept'), 'decline' => $this->trans->t('Decline'), + 'session.time.left' => $this->trans->t('You have {{session_time}} left before logout.'), // templates/views/vaults.html 'last.access' => $this->trans->t('Last accessed'), @@ -329,6 +330,7 @@ class TranslationController extends ApiController { 'input.vault.password' => $this->trans->t('Please input the password for'), 'vault.default' => $this->trans->t('Set this vault as default.'), 'vault.auto.login' => $this->trans->t('Login automatically to this vault.'), + 'auto.logout' => $this->trans->t('Logout of this vault automatically after: '), 'vault.decrypt' => $this->trans->t('Decrypt vault'), // templates/bookmarklet.php diff --git a/css/app.css b/css/app.css index f1e6e3e9..01c4364e 100644 --- a/css/app.css +++ b/css/app.css @@ -877,7 +877,7 @@ height: 200px; } #app-settings-content:not(.ng-hide) { - height: 60px; + height: 90px; display: inherit !important; padding: 0; transition: height 0.15s ease-out; } diff --git a/js/app/controllers/main.js b/js/app/controllers/main.js index 78d97bb2..b8f2dbbd 100644 --- a/js/app/controllers/main.js +++ b/js/app/controllers/main.js @@ -31,7 +31,7 @@ * Controller of the passmanApp */ angular.module('passmanApp') - .controller('MainCtrl', ['$scope', '$rootScope', '$location', 'SettingsService', function ($scope, $rootScope, $location, SettingsService) { + .controller('MainCtrl', ['$scope', '$rootScope', '$location', 'SettingsService', '$window', '$interval', '$filter', function ($scope, $rootScope, $location, SettingsService, $window, $interval, $filter) { $scope.selectedVault = false; $scope.http_warning_hidden = true; @@ -63,6 +63,30 @@ $rootScope.$on('logout', function () { $scope.selectedVault = false; }); + + var tickSessionTimer = function(){ + if($scope.session_time_left){ + $scope.session_time_left--; + var session_time_left_formatted = $filter('toHHMMSS')($scope.session_time_left); + $scope.translationData = { + session_time: session_time_left_formatted + }; + $rootScope.$broadcast('logout_timer_tick_tack', $scope.session_time_left); + if($scope.session_time_left === 0){ + $window.location.reload(); + } + } + }; + + $scope.session_time_left = false; + $scope.$on('logout_timer_set', function(evt, timer){ + $scope.session_time_left = timer; + $scope.translationData = { + session_time: timer + }; + $interval(tickSessionTimer, 1000); + }); + }]); }());
\ No newline at end of file diff --git a/js/app/controllers/vault.js b/js/app/controllers/vault.js index 99a868d4..08b3f7ca 100644 --- a/js/app/controllers/vault.js +++ b/js/app/controllers/vault.js @@ -67,6 +67,8 @@ $scope.default_vault = false; $scope.remember_vault_password = false; + $scope.auto_logout_timer = false; + $scope.logout_timer = '0'; $scope.list_selected_vault = false; $scope.minimal_value_key_strength = 3; @@ -98,6 +100,10 @@ } }; + $scope.toggleAutoLogout = function(){ + $scope.auto_logout_timer = !$scope.auto_logout_timer; + }; + $scope.clearState = function () { $scope.list_selected_vault = false; $scope.creating_vault = false; @@ -131,10 +137,20 @@ var _vault = angular.copy(vault); _vault.vaultKey = angular.copy(vault_key); delete _vault.credentials; + var timer = parseInt($scope.logout_timer); + if($scope.auto_logout_timer && timer > 0 ){ + $rootScope.$broadcast('logout_timer_set', timer*60); + } + VaultService.setActiveVault(_vault); $location.path('/vault/' + vault.guid); }; + $scope.selectLogoutTimer = function (time) { + $scope.auto_logout_timer = true; + $scope.logout_timer = time; + }; + $scope.vaultDecryptionKey = ''; $scope.loginToVault = function (vault, vault_key) { $scope.error = false; diff --git a/js/app/filters/toHHMMSS.js b/js/app/filters/toHHMMSS.js new file mode 100644 index 00000000..d7e4e4c2 --- /dev/null +++ b/js/app/filters/toHHMMSS.js @@ -0,0 +1,47 @@ +/** + * Nextcloud - passman + * + * @copyright Copyright (c) 2016, Sander Brand (brantje@gmail.com) + * @copyright Copyright (c) 2016, Marcos Zuriaga Miguel (wolfi@wolfi.es) + * @license GNU AGPL version 3 or any later version + * + * This program 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. + * + * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +(function () { + 'use strict'; + /** + * @ngdoc filter + * @name passmanApp.filter:decrypt + * @function + * @description + * # decrypt + * Filter in the passmanApp. + */ + angular.module('passmanApp') + .filter('toHHMMSS', function () { + return function (_seconds) { + var sec_num = parseInt(_seconds, 10); // don't forget the second param + var hours = Math.floor(sec_num / 3600); + var minutes = Math.floor((sec_num - (hours * 3600)) / 60); + var seconds = sec_num - (hours * 3600) - (minutes * 60); + + if (hours < 10) {hours = "0"+hours;} + if (minutes < 10) {minutes = "0"+minutes;} + if (seconds < 10) {seconds = "0"+seconds;} + return hours+':'+minutes+':'+seconds; + }; + }); +}());
\ No newline at end of file diff --git a/js/templates.js b/js/templates.js index 3ed9098c..55719e1d 100644 --- a/js/templates.js +++ b/js/templates.js @@ -113,12 +113,12 @@ 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', - '<div off-click="closeSelected()" off-click-filter="\'.download-js-link, .sidebar-shown\'"><div id="passman-controls" ng-class="{ \'sidebar-shown\': selectedCredential }"><div class="breadcrumb"><div class="breadcrumb"><div class="crumb svg ui-droppable" data-dir="/"><a><i class="fa fa-home"></i></a></div><div class="crumb svg last"><a>{{active_vault.name}}</a></div></div></div><span class="title" ng-if="delete_time">{{ \'deleted.since\' | translate }}: <span ng-if="delete_time == 1">All time</span> <span ng-if="delete_time > 1">{{delete_time | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</span></span><div class="actions creatable"><span ng-click="addCredential()" class="button new"><span>+</span></span></div><div class="title" ng-show="filtered_credentials.length > 0" translate="number.filtered" translate-values="{number_filtered: filtered_credentials.length, credential_number: active_vault.credentials.length - 1}"></div><div class="searchboxContainer" ng-init="filterOptionShown = false;" off-click="filterOptionShown = false;"><input type="text" ng-model="filterOptions.filterText" class="searchbox" id="searchBox" placeholder="{{\'search.credential\' | translate}}" select-on-click clear-btn ng-click="filterOptionShown = true;"><div class="searchOptions" ng-show="filterOptionShown"><input type="checkbox" ng-model="filterOptions.useRegex"> Use regex</div></div><div class="viewModes"><div class="view-mode" ng-class="{\'active\': view_mode === \'list\' }" ng-click="switchViewMode(\'list\')"><i class="fa fa-list"></i></div><div class="view-mode" ng-class="{\'active\': view_mode === \'grid\' }" ng-click="switchViewMode(\'grid\')"><i class="fa fa-th-large"></i></div></div></div><div class="loaderContainer" ng-if="show_spinner"><div class="loader" use-theme type="\'border-bottom-color\'"></div></div><div ng-init="menuOpen = false;"><table class="credential-table" ng-if="view_mode === \'list\'"><tr ng-repeat="credential in filtered_credentials | orderBy:\'label\'" ng-if="showCredentialRow(credential)" ng-click="selectCredential(credential)" ng-dblclick="editCredential(credential)" ng-class="{\'selected\': selectedCredential.credential_id == credential.credential_id}"><td><span class="tags"><span class="tag" ng-repeat="tag in credential.tags_raw">{{ ::tag.text}}</span></span> <span class="icon"><i class="fa fa-lock" ng-if="!credential.acl && !credential.shared_key"></i> <i class="fa fa-share-alt" ng-if="credential.acl"></i> <i class="fa fa-share-alt-square" ng-if="credential.shared_key"></i></span> <span class="label">{{ ::credential.label}}</span></td></tr></table><ul class="grid-view" ng-if="view_mode === \'grid\'"><li class="credential" ng-repeat="credential in filtered_credentials | orderBy:\'label\'" ng-if="credential.hidden == 0 && showCredentialRow(credential)" ng-click="selectCredential(credential)" use-theme type="\'border-color\'"><div class="credential_content"><div class="label">{{ ::credential.label}}</div><div class="tags"><div class="tag" ng-repeat="tag in credential.tags_raw">{{ ::tag.text}}</div></div></div></li></ul></div><div id="app-sidebar" class="detailsView scroll-container app_sidebar" ng-show="selectedCredential"><h2>{{selectedCredential.label}}</h2><span class="close icon-close" ng-click="closeSelected()" alt="Close"></span><div class="credential-data"><div class="row" ng-show="selectedCredential.username"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'account\' | translate }}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.username"></span></div></div><div class="row" ng-show="selectedCredential.password"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'password\' | translate }}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.password" secret="\'true\'"></span></div></div><div class="row" ng-show="selectedCredential.otp.secret"><div class="col-xs-4 col-md-3 col-lg-3">{{\'otp\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span otp-generator secret="selectedCredential.otp.secret"></span></div></div><div class="row" ng-show="selectedCredential.email"><div class="col-xs-4 col-md-3 col-lg-3">{{\'email\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.email"></span></div></div><div class="row" ng-show="selectedCredential.url"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'url\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.url"></span></div></div><div class="row" ng-show="selectedCredential.description"><div class="col-xs-4 col-md-3 col-lg-3">{{\'notes\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.description_html"></span></div></div><div class="row" ng-show="selectedCredential.files.length > 0"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'files\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><div ng-repeat="file in selectedCredential.files" class="link" ng-click="downloadFile(selectedCredential, file)">{{file.filename}} ({{file.size | bytes}})</div></div></div><div class="row" ng-repeat="field in selectedCredential.custom_fields"><div class="col-xs-4 col-md-3 col-lg-3">{{field.label}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="field.value" secret="field.secret" ng-if="field.field_type !== \'file\' || !field.field_type"></span> <span ng-if="field.field_type === \'file\'" class="link" ng-click="downloadFile(selectedCredential, field.value)">{{field.value.filename}} ({{field.value.size | bytes}})</span></div></div><div class="row" ng-show="selectedCredential.expire_time > 0"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'expire.time\' | translate }}</div><div class="col-xs-8 col-md-9 col-lg-9">{{selectedCredential.expire_time * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div><div class="row" ng-show="selectedCredential.changed"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'changed\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9">{{selectedCredential.changed * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div><div class="row" ng-show="selectedCredential.created"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'created\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9">{{selectedCredential.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div><div class="row"><div class="col-xs-12"><div class="tags"><span class="tag" ng-repeat="tag in selectedCredential.tags">{{tag.text}}</span></div></div></div></div><div ng-show="selectedCredential"><div><button class="button" ng-click="editCredential(selectedCredential)" ng-if="selectedCredential.delete_time == 0 && hasPermission(selectedCredential.acl.permissions, permissions.permissions.WRITE)"><span class="fa fa-edit"></span> {{ \'edit\' | translate}}</button> <button class="button" ng-click="deleteCredential(selectedCredential)" ng-if="selectedCredential.delete_time == 0 && hasPermission(selectedCredential.acl.permissions, permissions.permissions.WRITE)"><span class="fa fa-trash"></span> {{ \'delete\' | translate}}</button> <button class="button" ng-click="shareCredential(selectedCredential)" ng-if="selectedCredential.delete_time == 0 && selectedCredential.acl === undefined &&\n' + + '<div off-click="closeSelected()" off-click-filter="\'.download-js-link, .sidebar-shown\'"><div id="passman-controls" ng-class="{ \'sidebar-shown\': selectedCredential }"><div class="breadcrumb"><div class="breadcrumb"><div class="crumb svg ui-droppable" data-dir="/"><a><i class="fa fa-home"></i></a></div><div class="crumb svg last"><a>{{active_vault.name}}</a></div></div></div><span class="title" ng-if="delete_time">{{ \'deleted.since\' | translate }}: <span ng-if="delete_time == 1">All time</span> <span ng-if="delete_time > 1">{{delete_time | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</span></span><div class="actions creatable"><span ng-click="addCredential()" class="button new"><span>+</span></span></div><div class="title" ng-show="filtered_credentials.length > 0" translate="number.filtered" translate-values="{number_filtered: filtered_credentials.length, credential_number: active_vault.credentials.length - 1}"></div><div class="searchboxContainer" ng-init="filterOptionShown = false;" off-click="filterOptionShown = false;"><input type="text" ng-model="filterOptions.filterText" class="searchbox" id="searchBox" placeholder="{{\'search.credential\' | translate}}" select-on-click clear-btn ng-click="filterOptionShown = true;"><div class="searchOptions" ng-show="filterOptionShown"><input type="checkbox" ng-model="filterOptions.useRegex"> {{ \'use.regex\' | translate }}</div></div><div class="viewModes"><div class="view-mode" ng-class="{\'active\': view_mode === \'list\' }" ng-click="switchViewMode(\'list\')"><i class="fa fa-list"></i></div><div class="view-mode" ng-class="{\'active\': view_mode === \'grid\' }" ng-click="switchViewMode(\'grid\')"><i class="fa fa-th-large"></i></div></div></div><div class="loaderContainer" ng-if="show_spinner"><div class="loader" use-theme type="\'border-bottom-color\'"></div></div><div ng-init="menuOpen = false;"><table class="credential-table" ng-if="view_mode === \'list\'"><tr ng-repeat="credential in filtered_credentials | orderBy:\'label\'" ng-if="showCredentialRow(credential)" ng-click="selectCredential(credential)" ng-dblclick="editCredential(credential)" ng-class="{\'selected\': selectedCredential.credential_id == credential.credential_id}"><td><span class="tags"><span class="tag" ng-repeat="tag in credential.tags_raw">{{ ::tag.text}}</span></span> <span class="icon"><i class="fa fa-lock" ng-if="!credential.acl && !credential.shared_key"></i> <i class="fa fa-share-alt" ng-if="credential.acl"></i> <i class="fa fa-share-alt-square" ng-if="credential.shared_key"></i></span> <span class="label">{{ ::credential.label}}</span></td></tr></table><ul class="grid-view" ng-if="view_mode === \'grid\'"><li class="credential" ng-repeat="credential in filtered_credentials | orderBy:\'label\'" ng-if="credential.hidden == 0 && showCredentialRow(credential)" ng-click="selectCredential(credential)" use-theme type="\'border-color\'"><div class="credential_content"><div class="label">{{ ::credential.label}}</div><div class="tags"><div class="tag" ng-repeat="tag in credential.tags_raw">{{ ::tag.text}}</div></div></div></li></ul></div><div id="app-sidebar" class="detailsView scroll-container app_sidebar" ng-show="selectedCredential"><h2>{{selectedCredential.label}}</h2><span class="close icon-close" ng-click="closeSelected()" alt="Close"></span><div class="credential-data"><div class="row" ng-show="selectedCredential.username"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'account\' | translate }}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.username"></span></div></div><div class="row" ng-show="selectedCredential.password"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'password\' | translate }}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.password" secret="\'true\'"></span></div></div><div class="row" ng-show="selectedCredential.otp.secret"><div class="col-xs-4 col-md-3 col-lg-3">{{\'otp\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span otp-generator secret="selectedCredential.otp.secret"></span></div></div><div class="row" ng-show="selectedCredential.email"><div class="col-xs-4 col-md-3 col-lg-3">{{\'email\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.email"></span></div></div><div class="row" ng-show="selectedCredential.url"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'url\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.url"></span></div></div><div class="row" ng-show="selectedCredential.description"><div class="col-xs-4 col-md-3 col-lg-3">{{\'notes\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="selectedCredential.description_html"></span></div></div><div class="row" ng-show="selectedCredential.files.length > 0"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'files\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9"><div ng-repeat="file in selectedCredential.files" class="link" ng-click="downloadFile(selectedCredential, file)">{{file.filename}} ({{file.size | bytes}})</div></div></div><div class="row" ng-repeat="field in selectedCredential.custom_fields"><div class="col-xs-4 col-md-3 col-lg-3">{{field.label}}</div><div class="col-xs-8 col-md-9 col-lg-9"><span credential-field value="field.value" secret="field.secret" ng-if="field.field_type !== \'file\' || !field.field_type"></span> <span ng-if="field.field_type === \'file\'" class="link" ng-click="downloadFile(selectedCredential, field.value)">{{field.value.filename}} ({{field.value.size | bytes}})</span></div></div><div class="row" ng-show="selectedCredential.expire_time > 0"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'expire.time\' | translate }}</div><div class="col-xs-8 col-md-9 col-lg-9">{{selectedCredential.expire_time * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div><div class="row" ng-show="selectedCredential.changed"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'changed\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9">{{selectedCredential.changed * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div><div class="row" ng-show="selectedCredential.created"><div class="col-xs-4 col-md-3 col-lg-3">{{ \'created\' | translate}}</div><div class="col-xs-8 col-md-9 col-lg-9">{{selectedCredential.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</div></div><div class="row"><div class="col-xs-12"><div class="tags"><span class="tag" ng-repeat="tag in selectedCredential.tags">{{tag.text}}</span></div></div></div></div><div ng-show="selectedCredential"><div><button class="button" ng-click="editCredential(selectedCredential)" ng-if="selectedCredential.delete_time == 0 && hasPermission(selectedCredential.acl.permissions, permissions.permissions.WRITE)"><span class="fa fa-edit"></span> {{ \'edit\' | translate}}</button> <button class="button" ng-click="deleteCredential(selectedCredential)" ng-if="selectedCredential.delete_time == 0 && hasPermission(selectedCredential.acl.permissions, permissions.permissions.WRITE)"><span class="fa fa-trash"></span> {{ \'delete\' | translate}}</button> <button class="button" ng-click="shareCredential(selectedCredential)" ng-if="selectedCredential.delete_time == 0 && selectedCredential.acl === undefined &&\n' + ' (settings.user_sharing_enabled === 1 || settings.user_sharing_enabled === \'1\' || settings.link_sharing_enabled === 1 || settings.link_sharing_enabled === \'1\')"><span class="fa fa-share"></span> {{ \'share\' | translate}}</button> <button class="button" ng-click="getRevisions(selectedCredential)" ng-if="selectedCredential.delete_time == 0 && hasPermission(selectedCredential.acl.permissions, permissions.permissions.HISTORY)"><span class="fa fa-undo"></span> {{ \'revisions\' | translate}}</button> <button class="button" ng-if="selectedCredential.delete_time > 0" ng-click="recoverCredential(selectedCredential) && hasPermission(selectedCredential.acl.permissions, permissions.permissions.WRITE)"><span class="fa fa-recycle"></span> {{\'recover\' | translate}}</button> <button class="button" ng-if="selectedCredential.delete_time > 0" ng-click="destroyCredential(selectedCredential)"><span class="fa fa-bomb"></span> {{\'destroy\' | translate}}</button></div></div></div></div><div class="share_popup" style="display: none">{{ \'sharereq.title\' | translate}}<br>{{ \'sharereq.line1\' | translate}}<br>{{ \'sharereq.line2\' | translate}} {{active_vault.vault_id}}<table class="table"><thead><tr><td>{{ \'label\' | translate}}</td><td>{{ \'permissions\' | translate}}</td><td>{{ \'received.from\' | translate}}</td><td>{{ \'date\' | translate}}</td></tr></thead><tr ng-repeat="share_request in incoming_share_requests" ng-if="share_request.target_vault_id == active_vault.vault_id"><td>{{share_request.credential_label}}</td><td>{{share_request.permissions}}</td><td>{{share_request.from_user_id}}</td><td>{{share_request.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</td><td><span class="link" ng-click="acceptShareRequest(share_request)">{{ \'accept\' | translate}}</span> | <span class="link" ng-click="declineShareRequest(share_request)">{{ \'decline\' | translate}}</span></td></tr></table></div>'); }]); angular.module('views/vaults.html', []).run(['$templateCache', function($templateCache) { 'use strict'; $templateCache.put('views/vaults.html', - '<div class="vault_wrapper"><div class="vaults" ng-if="!list_selected_vault && !creating_vault"><div class="ui-select-container ui-select-bootstrap vaultlist"><ul><li ng-click="newVault()">+ Create a new vault</li><li ng-repeat="vault in vaults" ng-class="{\'selected\': vault == list_selected_vault }" ng-click="selectVault(vault)"><div><span class="ui-select-choices-row-inner"><div class="ng-binding ng-scope">{{vault.name}}</div><small class="ng-binding ng-scope">{{ \'created\' | translate}}: {{vault.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}} | {{ \'last.access\' | translate}}: <span ng-if="vault.last_access > 0">{{vault.last_access * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</span> <span ng-if="vault.last_access === 0">{{\'never\' | translate}}</span></small></span></div></li><li ng-if="vaults.length === 0">{{ \'no.vaults\' | translate}}</li></ul></div></div><div ng-if="creating_vault"><div class="login_form" ng-init="vault_name = \'\'; vault_key=\'\'; ">{{\'new.vault.name\' | translate}}<div><input type="text" ng-model="vault_name" required></div><div>{{ \'new.vault.pass\' | translate}} <input type="password" ng-model="vault_key" required><ng-password-meter password="vault_key" score="vault_key_score"></ng-password-meter></div><div>{{ \'new.vault.passr\' | translate}} <input type="password" ng-model="vault_key2" required></div><div ng-show="error || vault_key_score.score < minimal_value_key_strength" class="error"><ul><li ng-show="error">{{error}}</li><li ng-show="vault_key_score.score < minimal_value_key_strength">{{\'min.vault.key.strength\' | translate:required_score}}</li></ul></div><div><small>{{\'new.vault.sharing_key_notice\' | translate}}</small></div><div class="button_wrapper"><button class="button button-geen" ng-if="!creating_keys" ng-click="createVault(vault_name, vault_key, vault_key2)" ng-disabled="vault_key_score.score < minimal_value_key_strength || vault_key !== vault_key2 || vault_key === \'\'">{{ \'new.vault.create\' | translate }}</button><div class="button" ng-if="creating_keys"><span><i class="fa fa-spinner fa-spin"></i> {{creating_keys}}</span></div><div class="button button-red" ng-click="clearState()">{{ \'cancel\' | translate}}</div><div class="hidden">{{sharing_keys}}</div></div></div></div><div ng-if="list_selected_vault != false"><div class="vaultlist"><ul><li ng-click="clearState()">{{ \'go.back.vaults\' | translate }}</li></ul></div><div class="login_form"><div ng-show="error" class="error"><ul><li>{{error}}</li></ul></div>{{ \'input.vault.password\' | translate}} {{list_selected_vault.name}}<div class="pw-input"><input type="password" ng-model="vault_key" ng-enter="loginToVault(list_selected_vault, vault_key)"> <small class="last_access">{{\'last.access\' | translate}}: <span ng-if="list_selected_vault.last_access > 0">{{list_selected_vault.last_access * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</span> <span ng-if="list_selected_vault.last_access === 0">Never</span></small></div><div><div><label><input type="checkbox" ng-checked="default_vault" ng-click="toggleDefaultVault()"> {{ \'vault.default\' | translate}}</label></div><div><label><input type="checkbox" ng-checked="remember_vault_password" ng-click="toggleRememberPassword()"> {{ \'vault.auto.login\' | translate}}</label></div></div><div class="button button-geen" ng-click="loginToVault(list_selected_vault, vault_key)">{{ \'vault.decrypt\' | translate}}</div></div></div></div>'); + '<div class="vault_wrapper"><div class="vaults" ng-if="!list_selected_vault && !creating_vault"><div class="ui-select-container ui-select-bootstrap vaultlist"><ul><li ng-click="newVault()">+ Create a new vault</li><li ng-repeat="vault in vaults" ng-class="{\'selected\': vault == list_selected_vault }" ng-click="selectVault(vault)"><div><span class="ui-select-choices-row-inner"><div class="ng-binding ng-scope">{{vault.name}}</div><small class="ng-binding ng-scope">{{ \'created\' | translate}}: {{vault.created * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}} | {{ \'last.access\' | translate}}: <span ng-if="vault.last_access > 0">{{vault.last_access * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</span> <span ng-if="vault.last_access === 0">{{\'never\' | translate}}</span></small></span></div></li><li ng-if="vaults.length === 0">{{ \'no.vaults\' | translate}}</li></ul></div></div><div ng-if="creating_vault"><div class="login_form" ng-init="vault_name = \'\'; vault_key=\'\'; ">{{\'new.vault.name\' | translate}}<div><input type="text" ng-model="vault_name" required></div><div>{{ \'new.vault.pass\' | translate}} <input type="password" ng-model="vault_key" required><ng-password-meter password="vault_key" score="vault_key_score"></ng-password-meter></div><div>{{ \'new.vault.passr\' | translate}} <input type="password" ng-model="vault_key2" required></div><div ng-show="error || vault_key_score.score < minimal_value_key_strength" class="error"><ul><li ng-show="error">{{error}}</li><li ng-show="vault_key_score.score < minimal_value_key_strength">{{\'min.vault.key.strength\' | translate:required_score}}</li></ul></div><div><small>{{\'new.vault.sharing_key_notice\' | translate}}</small></div><div class="button_wrapper"><button class="button button-geen" ng-if="!creating_keys" ng-click="createVault(vault_name, vault_key, vault_key2)" ng-disabled="vault_key_score.score < minimal_value_key_strength || vault_key !== vault_key2 || vault_key === \'\'">{{ \'new.vault.create\' | translate }}</button><div class="button" ng-if="creating_keys"><span><i class="fa fa-spinner fa-spin"></i> {{creating_keys}}</span></div><div class="button button-red" ng-click="clearState()">{{ \'cancel\' | translate}}</div><div class="hidden">{{sharing_keys}}</div></div></div></div><div ng-if="list_selected_vault != false"><div class="vaultlist"><ul><li ng-click="clearState()">{{ \'go.back.vaults\' | translate }}</li></ul></div><div class="login_form"><div ng-show="error" class="error"><ul><li>{{error}}</li></ul></div>{{ \'input.vault.password\' | translate}} {{list_selected_vault.name}}<div class="pw-input"><input type="password" ng-model="vault_key" ng-enter="loginToVault(list_selected_vault, vault_key)"> <small class="last_access">{{\'last.access\' | translate}}: <span ng-if="list_selected_vault.last_access > 0">{{list_selected_vault.last_access * 1000 | date:\'dd-MM-yyyy @ HH:mm:ss\'}}</span> <span ng-if="list_selected_vault.last_access === 0">Never</span></small></div><div><div><label><input type="checkbox" ng-checked="default_vault" ng-click="toggleDefaultVault()"> {{ \'vault.default\' | translate}}</label></div><div><label><input type="checkbox" ng-checked="remember_vault_password" ng-click="toggleRememberPassword()"> {{ \'vault.auto.login\' | translate}}</label></div><div><label><input type="checkbox" ng-checked="auto_logout_timer" ng-click="toggleAutoLogout()"> {{ \'auto.logout\' | translate}}</label><select ng-model="logout_timer" ng-change="selectLogoutTimer(logout_timer)"><option value="0">Never</option><option value="30">30 minutes</option><option value="60">60 minutes</option><option value="90">90 minutes</option><option value="180">3 hour</option><option value="480">8 hour</option></select></div></div><div class="button button-geen" ng-click="loginToVault(list_selected_vault, vault_key)">{{ \'vault.decrypt\' | translate}}</div></div></div></div>'); }]); diff --git a/sass/app.scss b/sass/app.scss index 85e7049a..f8d384fb 100644 --- a/sass/app.scss +++ b/sass/app.scss @@ -33,7 +33,7 @@ @import 'settings'; #app-settings-content:not(.ng-hide) { - height: 60px; + height: 90px; display: inherit !important; padding: 0; transition: height 0.15s ease-out; diff --git a/templates/main.php b/templates/main.php index 801196c9..7109179e 100644 --- a/templates/main.php +++ b/templates/main.php @@ -51,6 +51,7 @@ script('passman', 'app/filters/byte'); script('passman', 'app/filters/tagfilter'); script('passman', 'app/filters/as'); script('passman', 'app/filters/credentialsearch'); +script('passman', 'app/filters/toHHMMSS'); script('passman', 'app/services/cacheservice'); script('passman', 'app/services/vaultservice'); script('passman', 'app/services/credentialservice'); @@ -104,13 +105,13 @@ style('passman', 'app'); ?> <div id="app" ng-app="passmanApp" ng-controller="MainCtrl"> - + <div id="logoutTimer"> </div> <div class="warning_bar" ng-if="using_http && http_warning_hidden == false"> {{ 'http.warning' | translate }} <i class="fa fa-times fa-2x" alt="Close" ng-click="setHttpWarning(true);"></i> </div> - <div id="app-navigation" ng-if="selectedVault" ng-controller="MenuCtrl"> + <div id="app-navigation" ng-show="selectedVault" ng-controller="MenuCtrl"> <ul> <li class="taginput"> <a class="taginput"> @@ -131,6 +132,7 @@ style('passman', 'app'); </a> </li> </ul> + <div id="app-settings" ng-init="settingsShown = false;"> <div id="app-settings-header"> <button class="settings-button" @@ -144,6 +146,9 @@ style('passman', 'app'); <div><a class="link" ng-href="#/vault/{{active_vault.guid}}/settings">{{ 'settings' | translate }}</a></div> <div><span class="link" ng-click="logout()">{{'logout' | translate }}</span></div> <div><a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6YS8F97PETVU2" target="_blank" class="link">{{ 'donate' | translate }}</a></div> + <div ng-show="session_time_left"> + <small>{{'session.time.left' | translate:translationData}}</small> + </div> </div> </div> </div> diff --git a/templates/views/show_vault.html b/templates/views/show_vault.html index 174f6f3f..9821c394 100644 --- a/templates/views/show_vault.html +++ b/templates/views/show_vault.html @@ -29,7 +29,7 @@ <input type="text" ng-model="filterOptions.filterText" class="searchbox" id="searchBox" placeholder="{{'search.credential' | translate}}" select-on-click clear-btn ng-click="filterOptionShown = true;"> <div class="searchOptions" ng-show="filterOptionShown"> - <input type="checkbox" ng-model="filterOptions.useRegex"> Use regex + <input type="checkbox" ng-model="filterOptions.useRegex"> {{ 'use.regex' | translate }} </div> </div> <div class="viewModes"> diff --git a/templates/views/vaults.html b/templates/views/vaults.html index 26080899..17a45e28 100644 --- a/templates/views/vaults.html +++ b/templates/views/vaults.html @@ -111,6 +111,22 @@ {{ 'vault.auto.login' | translate}} </label> </div> + <div> + <label> + <input type="checkbox" + ng-checked="auto_logout_timer" + ng-click="toggleAutoLogout()"> + {{ 'auto.logout' | translate}} + </label> + <select ng-model="logout_timer" ng-change="selectLogoutTimer(logout_timer)"> + <option value="0">Never</option> + <option value="30">30 minutes</option> + <option value="60">60 minutes</option> + <option value="90">90 minutes</option> + <option value="180">3 hour</option> + <option value="480">8 hour</option> + </select> + </div> </div> <div class="button button-geen" ng-click="loginToVault(list_selected_vault, vault_key)"> |