summaryrefslogtreecommitdiffstats
path: root/settings/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'settings/Controller')
-rw-r--r--settings/Controller/UsersController.php48
1 files changed, 24 insertions, 24 deletions
diff --git a/settings/Controller/UsersController.php b/settings/Controller/UsersController.php
index 293afe9e6ff..7ce4355aa0b 100644
--- a/settings/Controller/UsersController.php
+++ b/settings/Controller/UsersController.php
@@ -537,19 +537,19 @@ class UsersController extends Controller {
);
}
- if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
- return new DataResponse(
- array(
- 'status' => 'error',
- 'data' => array(
- 'message' => (string)$this->l10n->t('Authentication error')
- )
- ),
- Http::STATUS_FORBIDDEN
- );
- }
-
if($user) {
+ if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
+ return new DataResponse(
+ array(
+ 'status' => 'error',
+ 'data' => array(
+ 'message' => (string)$this->l10n->t('Authentication error')
+ )
+ ),
+ Http::STATUS_FORBIDDEN
+ );
+ }
+
$user->setEnabled(false);
return new DataResponse(
array(
@@ -594,19 +594,19 @@ class UsersController extends Controller {
);
}
- if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
- return new DataResponse(
- array(
- 'status' => 'error',
- 'data' => array(
- 'message' => (string)$this->l10n->t('Authentication error')
- )
- ),
- Http::STATUS_FORBIDDEN
- );
- }
-
if($user) {
+ if(!$this->isAdmin && !$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user)) {
+ return new DataResponse(
+ array(
+ 'status' => 'error',
+ 'data' => array(
+ 'message' => (string)$this->l10n->t('Authentication error')
+ )
+ ),
+ Http::STATUS_FORBIDDEN
+ );
+ }
+
$user->setEnabled(true);
return new DataResponse(
array(