summaryrefslogtreecommitdiffstats
path: root/settings/js
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-11-10 17:18:12 +0100
committerLukas Reschke <lukas@statuscode.ch>2016-11-18 12:10:51 +0100
commita53c313878d04b71b383af7e5d013f30f07ae1e2 (patch)
treee62a6bc6d13a35b1036d9e56021d78d4bb82a6e7 /settings/js
parent05df523395e2c9a06378f23dfd6e5439df14dffe (diff)
downloadnextcloud-server-a53c313878d04b71b383af7e5d013f30f07ae1e2.tar.gz
nextcloud-server-a53c313878d04b71b383af7e5d013f30f07ae1e2.zip
Require password confirmation to change the Quota
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'settings/js')
-rw-r--r--settings/js/users/users.js15
1 files changed, 12 insertions, 3 deletions
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index c2f1eb3c00f..6847f06a8b2 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -539,7 +539,7 @@ var UserList = {
OC.Notification.showTemporary(t('core', 'Invalid quota value "{val}"', {val: quota}));
return;
}
- UserList._updateQuota(uid, quota, function(returnedQuota){
+ UserList._updateQuota(uid, quota, function(returnedQuota) {
if (quota !== returnedQuota) {
$select.find(':selected').text(returnedQuota);
}
@@ -553,12 +553,21 @@ var UserList = {
* @param {Function} ready callback after save
*/
_updateQuota: function(uid, quota, ready) {
+ if (OC.PasswordConfirmation.requiresPasswordConfirmation()) {
+ OC.PasswordConfirmation.requirePasswordConfirmation(_.bind(this._updateQuota, this, uid, quota, ready));
+ return;
+ }
+
$.post(
OC.filePath('settings', 'ajax', 'setquota.php'),
{username: uid, quota: quota},
function (result) {
- if (ready) {
- ready(result.data.quota);
+ if (result.status === 'error') {
+ OC.Notification.showTemporary(result.data.message);
+ } else {
+ if (ready) {
+ ready(result.data.quota);
+ }
}
}
);