aboutsummaryrefslogtreecommitdiffstats
path: root/settings
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2016-10-11 12:07:20 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-04-29 00:59:09 -0300
commit485d6d657761370dc200d9cdb023ad564c23c4e9 (patch)
tree51780af96b14ebdc716922fdc5fa647310ab45b4 /settings
parent2507e7459d42e47f0581aeb69b738fec6497c6b5 (diff)
downloadnextcloud-server-485d6d657761370dc200d9cdb023ad564c23c4e9.tar.gz
nextcloud-server-485d6d657761370dc200d9cdb023ad564c23c4e9.zip
use proper return codes and handle failure cases
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'settings')
-rw-r--r--settings/Controller/UsersController.php6
-rw-r--r--settings/js/users/users.js10
2 files changed, 13 insertions, 3 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index 411269a4351..56944ced984 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -567,7 +567,8 @@ class UsersController extends Controller {
'data' => array(
'message' => (string)$this->l10n->t('Error while disabling user.')
)
- )
+ ),
+ Http::STATUS_FORBIDDEN
);
}
}
@@ -624,7 +625,8 @@ class UsersController extends Controller {
'data' => array(
'message' => (string)$this->l10n->t('Error while enabling user.')
)
- )
+ ),
+ Http::STATUS_FORBIDDEN
);
}
}
diff --git a/settings/js/users/users.js b/settings/js/users/users.js
index 2a0b0c09a92..387709cd64c 100644
--- a/settings/js/users/users.js
+++ b/settings/js/users/users.js
@@ -949,7 +949,15 @@ $(document).ready(function () {
OC.dialogs.alert(result.data.message, t('settings', 'Error while changing status of {user}', {user: uid}));
}
}
- );
+ ).fail(function(result){
+ var message = 'Unknown error';
+ if( result.responseJSON &&
+ result.responseJSON.data &&
+ result.responseJSON.data.message) {
+ message = result.responseJSON.data.message;
+ }
+ OC.dialogs.alert(message, t('settings', 'Error while changing status of {user}', {user: uid}));
+ });
});
// init the quota field select box after it is shown the first time