diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-01-23 17:45:45 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2015-01-27 13:23:19 +0100 |
commit | 9fbeaf0fd9f3ba4cd01aa566553cb2373dde8cb2 (patch) | |
tree | 183f374f0021c680fffd95238457c16af071da45 /settings/js | |
parent | 5da4071c4553b5ee64799856e4db58e9484d9839 (diff) | |
download | nextcloud-server-9fbeaf0fd9f3ba4cd01aa566553cb2373dde8cb2.tar.gz nextcloud-server-9fbeaf0fd9f3ba4cd01aa566553cb2373dde8cb2.zip |
Add value if restore of data is possible for a user
* reason: nice to know before password change in user management
* restore is possible:
* encryption is disabled
* encryption is enabled, admin and user has checked the
restore option
* if not possible:
* highlight users row in red once the admin wants to change the password
* show also a little tipsy
Diffstat (limited to 'settings/js')
-rw-r--r-- | settings/js/users/users.js | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js index f21c660b41f..1a755ab7b25 100644 --- a/settings/js/users/users.js +++ b/settings/js/users/users.js @@ -42,6 +42,7 @@ var UserList = { * 'lastLogin': '1418632333' * 'backend': 'LDAP', * 'email': 'username@example.org' + * 'isRestoreDisabled':false * } * @param sort * @returns table row created for this user @@ -63,11 +64,12 @@ var UserList = { } /** - * add username and displayname to row (in data and visible markup + * add username and displayname to row (in data and visible markup) */ $tr.data('uid', user.name); $tr.data('displayname', user.displayname); $tr.data('mailAddress', user.email); + $tr.data('restoreDisabled', user.isRestoreDisabled); $tr.find('td.name').text(user.name); $tr.find('td.displayName > span').text(user.displayname); $tr.find('td.mailAddress > span').text(user.email); @@ -352,6 +354,9 @@ var UserList = { getMailAddress: function(element) { return ($(element).closest('tr').data('mailAddress') || '').toString(); }, + getRestoreDisabled: function(element) { + return ($(element).closest('tr').data('restoreDisabled') || ''); + }, initDeleteHandling: function() { //set up handler UserDeleteHandler = new DeleteHandler('/settings/users/users', 'username', @@ -627,8 +632,16 @@ $(document).ready(function () { event.stopPropagation(); var $td = $(this).closest('td'); + var $tr = $(this).closest('tr'); var uid = UserList.getUID($td); var $input = $('<input type="password">'); + var isRestoreDisabled = UserList.getRestoreDisabled($td) === true; + if(isRestoreDisabled) { + $tr.addClass('row-warning'); + // add tipsy if the password change could cause data loss - no recovery enabled + $input.tipsy({gravity:'s', fade:false}); + $input.attr('title', t('settings', 'Changing the password will result in data loss, because data recovery is not available for this user')); + } $td.find('img').hide(); $td.children('span').replaceWith($input); $input @@ -655,6 +668,8 @@ $(document).ready(function () { .blur(function () { $(this).replaceWith($('<span>●●●●●●●</span>')); $td.find('img').show(); + // remove highlight class from users without recovery ability + $tr.removeClass('row-warning'); }); }); $('input:password[id="recoveryPassword"]').keyup(function() { |