summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2017-06-19 11:35:46 -0500
committerGitHub <noreply@github.com>2017-06-19 11:35:46 -0500
commit60edf2f18ab40439e2efb1d20e594f2797b6f31b (patch)
tree69a2144353a949e95a2b9146d373b444032f5ead
parent09a027ddff6191ee60584fce104c1a1709f9614b (diff)
parent35413d991272b711628fb9b523ab0c145092c2a4 (diff)
downloadnextcloud-server-60edf2f18ab40439e2efb1d20e594f2797b6f31b.tar.gz
nextcloud-server-60edf2f18ab40439e2efb1d20e594f2797b6f31b.zip
Merge pull request #5459 from nextcloud/issue-5399-dont-reload-on-subadmin-setting-change
Don't try to save the setting when its not an admin
-rw-r--r--settings/js/users/users.js32
1 files changed, 24 insertions, 8 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index dccbcc0ce1e..df574bbc949 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -1083,10 +1083,14 @@ $(document).ready(function () {
$('#CheckboxLastLogin').click(function() {
if ($('#CheckboxLastLogin').is(':checked')) {
$("#userlist .lastLogin").show();
- OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'true');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'true');
+ }
} else {
$("#userlist .lastLogin").hide();
- OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'false');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_show_last_login', 'false');
+ }
}
});
@@ -1097,10 +1101,14 @@ $(document).ready(function () {
$('#CheckboxEmailAddress').click(function() {
if ($('#CheckboxEmailAddress').is(':checked')) {
$("#userlist .mailAddress").show();
- OCP.AppConfig.setValue('core', 'umgmt_show_email', 'true');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_show_email', 'true');
+ }
} else {
$("#userlist .mailAddress").hide();
- OCP.AppConfig.setValue('core', 'umgmt_show_email', 'false');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_show_email', 'false');
+ }
}
});
@@ -1111,10 +1119,14 @@ $(document).ready(function () {
$('#CheckboxUserBackend').click(function() {
if ($('#CheckboxUserBackend').is(':checked')) {
$("#userlist .userBackend").show();
- OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'true');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'true');
+ }
} else {
$("#userlist .userBackend").hide();
- OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'false');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_show_backend', 'false');
+ }
}
});
@@ -1125,10 +1137,14 @@ $(document).ready(function () {
$('#CheckboxMailOnUserCreate').click(function() {
if ($('#CheckboxMailOnUserCreate').is(':checked')) {
$("#newemail").show();
- OCP.AppConfig.setValue('core', 'umgmt_send_email', 'true');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_send_email', 'true');
+ }
} else {
$("#newemail").hide();
- OCP.AppConfig.setValue('core', 'umgmt_send_email', 'false');
+ if (OC.isUserAdmin()) {
+ OCP.AppConfig.setValue('core', 'umgmt_send_email', 'false');
+ }
}
});