diff options
author | Lukas Reschke <lukas@owncloud.com> | 2014-12-08 15:32:59 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2014-12-08 15:32:59 +0100 |
commit | 8b3e3890628fa00d50c94af1131cbe3cd63e4a12 (patch) | |
tree | a07a6c8ae9353aa5dcc37e0510ecf5004b0cb42f /settings/controller | |
parent | 3a49411051b3ad194b7296658c9177cbee82a74d (diff) | |
download | nextcloud-server-8b3e3890628fa00d50c94af1131cbe3cd63e4a12.tar.gz nextcloud-server-8b3e3890628fa00d50c94af1131cbe3cd63e4a12.zip |
Add statuscodes
Diffstat (limited to 'settings/controller')
-rw-r--r-- | settings/controller/groupscontroller.php | 18 | ||||
-rw-r--r-- | settings/controller/userscontroller.php | 22 |
2 files changed, 27 insertions, 13 deletions
diff --git a/settings/controller/groupscontroller.php b/settings/controller/groupscontroller.php index 6e6ab894605..8236d5507f4 100644 --- a/settings/controller/groupscontroller.php +++ b/settings/controller/groupscontroller.php @@ -10,6 +10,7 @@ namespace OC\Settings\Controller; +use OC\AppFramework\Http; use \OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; use OCP\IGroupManager; @@ -85,7 +86,8 @@ class GroupsController extends Controller { 'data' => array( 'message' => (string)$this->l10n->t('Group already exists.') ) - ) + ), + Http::STATUS_CONFLICT ); } if($this->groupManager->createGroup($id)) { @@ -95,7 +97,8 @@ class GroupsController extends Controller { 'data' => array( 'groupname' => $id ) - ) + ), + Http::STATUS_CREATED ); } @@ -105,7 +108,8 @@ class GroupsController extends Controller { 'data' => array( 'message' => (string)$this->l10n->t('Unable to add group.') ) - ) + ), + Http::STATUS_FORBIDDEN ); } @@ -123,7 +127,8 @@ class GroupsController extends Controller { 'data' => array( 'groupname' => $id ) - ) + ), + Http::STATUS_NO_CONTENT ); } } @@ -132,8 +137,9 @@ class GroupsController extends Controller { 'status' => 'error', 'data' => array( 'message' => (string)$this->l10n->t('Unable to delete group.') - ) - ) + ), + ), + Http::STATUS_FORBIDDEN ); } diff --git a/settings/controller/userscontroller.php b/settings/controller/userscontroller.php index d61d19f8cb4..aa16574221e 100644 --- a/settings/controller/userscontroller.php +++ b/settings/controller/userscontroller.php @@ -10,6 +10,7 @@ namespace OC\Settings\Controller; +use OC\AppFramework\Http; use OC\User\User; use \OCP\AppFramework\Controller; use OCP\AppFramework\Http\DataResponse; @@ -164,7 +165,8 @@ class UsersController extends Controller { 'data' => array( 'message' => (string)$this->l10n->t('Unable to create user.') ) - ) + ), + Http::STATUS_FORBIDDEN ); } @@ -187,7 +189,8 @@ class UsersController extends Controller { 'groups' => $this->groupManager->getUserGroupIds($user), 'storageLocation' => $user->getHome() ) - ) + ), + Http::STATUS_CREATED ); } @@ -208,7 +211,8 @@ class UsersController extends Controller { 'data' => array( 'message' => (string)$this->l10n->t('Unable to delete user.') ) - ) + ), + Http::STATUS_FORBIDDEN ); } @@ -218,8 +222,10 @@ class UsersController extends Controller { array( 'status' => 'error', 'data' => array( - 'message' => (string)$this->l10n->t('Authentication error')) - ) + 'message' => (string)$this->l10n->t('Authentication error') + ) + ), + Http::STATUS_FORBIDDEN ); } @@ -232,7 +238,8 @@ class UsersController extends Controller { 'data' => array( 'username' => $id ) - ) + ), + Http::STATUS_NO_CONTENT ); } } @@ -243,7 +250,8 @@ class UsersController extends Controller { 'data' => array( 'message' => (string)$this->l10n->t('Unable to delete user.') ) - ) + ), + Http::STATUS_FORBIDDEN ); } |