Skip to content

Commit

Permalink
Merge pull request #31489 from owncloud/stable10-fix-phpdoc
Browse files Browse the repository at this point in the history
Fix php doc so that hasAnnotation works properly
  • Loading branch information
phil-davis authored May 21, 2018
2 parents 4fff744 + 20e9c78 commit 2e10e7f
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions settings/Controller/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ public function sendEmail($userId, $mailAddress) {
));
}
return true;
}
}

/**
* @NoAdminRequired
Expand Down Expand Up @@ -867,58 +867,58 @@ public function changeMail($token, $userId) {
}
}
return new RedirectResponse($this->urlGenerator->linkToRoute('settings.SettingsPage.getPersonal', ['changestatus' => 'success', 'user' => $userId]));
}
/*
}

/**
* @NoAdminRequired
*
* @param string $id
* @return DataResponse
*/
public function setEnabled($id, $enabled) {
$userId = $this->userSession->getUser()->getUID();
$user = $this->userManager->get($id);

if($userId === $id ||
(!$this->isAdmin &&
!$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user))) {
return new DataResponse(
array(
'status' => 'error',
'data' => array(
'message' => (string)$this->l10n->t('Forbidden')
)
),
Http::STATUS_FORBIDDEN
);
}


if(!$user){
return new DataResponse(
array(
'status' => 'error',
'data' => array(
'message' => (string)$this->l10n->t('Invalid user')
)
),
Http::STATUS_UNPROCESSABLE_ENTITY
);
}
$userId = $this->userSession->getUser()->getUID();
$user = $this->userManager->get($id);

if($userId === $id ||
(!$this->isAdmin &&
!$this->groupManager->getSubAdmin()->isUserAccessible($this->userSession->getUser(), $user))) {
return new DataResponse(
array(
'status' => 'error',
'data' => array(
'message' => (string)$this->l10n->t('Forbidden')
)
),
Http::STATUS_FORBIDDEN
);
}


if(!$user) {
return new DataResponse(
array(
'status' => 'error',
'data' => array(
'message' => (string)$this->l10n->t('Invalid user')
)
),
Http::STATUS_UNPROCESSABLE_ENTITY
);
}


$value = filter_var($enabled, FILTER_VALIDATE_BOOLEAN);
if(!isset($value) || is_null($value))
{
return new DataResponse(
array(
'status' => 'error',
'data' => array(
'message' => (string)$this->l10n->t('Unable to enable/disable user.')
)
),
Http::STATUS_FORBIDDEN
);
return new DataResponse(
array(
'status' => 'error',
'data' => array(
'message' => (string)$this->l10n->t('Unable to enable/disable user.')
)
),
Http::STATUS_FORBIDDEN
);
}

$user->setEnabled($value);
Expand Down

0 comments on commit 2e10e7f

Please sign in to comment.