Don't try to save the setting when its not an admin

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-06-19 12:55:00 +02:00
parent 0277400618
commit 9ae715de75
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 24 additions and 8 deletions

View File

@ -1083,11 +1083,15 @@ $(document).ready(function () {
$('#CheckboxLastLogin').click(function() {
if ($('#CheckboxLastLogin').is(':checked')) {
$("#userlist .lastLogin").show();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'true');
}
} else {
$("#userlist .lastLogin").hide();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'false');
}
}
});
if ($('#CheckboxEmailAddress').is(':checked')) {
@ -1097,11 +1101,15 @@ $(document).ready(function () {
$('#CheckboxEmailAddress').click(function() {
if ($('#CheckboxEmailAddress').is(':checked')) {
$("#userlist .mailAddress").show();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_show_email', 'true');
}
} else {
$("#userlist .mailAddress").hide();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_show_email', 'false');
}
}
});
if ($('#CheckboxUserBackend').is(':checked')) {
@ -1111,11 +1119,15 @@ $(document).ready(function () {
$('#CheckboxUserBackend').click(function() {
if ($('#CheckboxUserBackend').is(':checked')) {
$("#userlist .userBackend").show();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'true');
}
} else {
$("#userlist .userBackend").hide();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'false');
}
}
});
if ($('#CheckboxMailOnUserCreate').is(':checked')) {
@ -1125,11 +1137,15 @@ $(document).ready(function () {
$('#CheckboxMailOnUserCreate').click(function() {
if ($('#CheckboxMailOnUserCreate').is(':checked')) {
$("#newemail").show();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_send_email', 'true');
}
} else {
$("#newemail").hide();
if (OC.isUserAdmin()) {
OCP.AppConfig.setValue('core', 'umgmt_send_email', 'false');
}
}
});
// calculate initial limit of users to load