|
|
|
@ -144,6 +144,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param int|null $limit Limit the amount of groups returned |
|
|
|
|
* @param int $offset Offset for searching for groups |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array{users: string[]}, array{}> |
|
|
|
|
* |
|
|
|
|
* 200: Users returned |
|
|
|
|
*/ |
|
|
|
|
public function getUsers(string $search = '', int $limit = null, int $offset = 0): DataResponse { |
|
|
|
|
$user = $this->userSession->getUser(); |
|
|
|
@ -183,6 +185,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param int|null $limit Limit the amount of groups returned |
|
|
|
|
* @param int $offset Offset for searching for groups |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array{users: array<string, ProvisioningApiUserDetails|array{id: string}>}, array{}> |
|
|
|
|
* |
|
|
|
|
* 200: Users details returned |
|
|
|
|
*/ |
|
|
|
|
public function getUsersDetails(string $search = '', int $limit = null, int $offset = 0): DataResponse { |
|
|
|
|
$currentUser = $this->userSession->getUser(); |
|
|
|
@ -537,6 +541,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID of the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, ProvisioningApiUserDetails, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User returned |
|
|
|
|
*/ |
|
|
|
|
public function getUser(string $userId): DataResponse { |
|
|
|
|
$includeScopes = false; |
|
|
|
@ -561,6 +567,8 @@ class UsersController extends AUserData { |
|
|
|
|
* |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, ProvisioningApiUserDetails, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: Current user returned |
|
|
|
|
*/ |
|
|
|
|
public function getCurrentUser(): DataResponse { |
|
|
|
|
$user = $this->userSession->getUser(); |
|
|
|
@ -581,6 +589,8 @@ class UsersController extends AUserData { |
|
|
|
|
* |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, string[], array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: Editable fields returned |
|
|
|
|
*/ |
|
|
|
|
public function getEditableFields(): DataResponse { |
|
|
|
|
$currentLoggedInUser = $this->userSession->getUser(); |
|
|
|
@ -600,6 +610,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID of the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, string[], array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: Editable fields for user returned |
|
|
|
|
*/ |
|
|
|
|
public function getEditableFieldsForUser(string $userId): DataResponse { |
|
|
|
|
$currentLoggedInUser = $this->userSession->getUser(); |
|
|
|
@ -666,6 +678,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $value New value for the key |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User values edited successfully |
|
|
|
|
*/ |
|
|
|
|
public function editUserMultiValue( |
|
|
|
|
string $userId, |
|
|
|
@ -765,6 +779,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $value New value for the key |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User value edited successfully |
|
|
|
|
*/ |
|
|
|
|
public function editUser(string $userId, string $key, string $value): DataResponse { |
|
|
|
|
$currentLoggedInUser = $this->userSession->getUser(); |
|
|
|
@ -1076,6 +1092,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: Wiped all user devices successfully |
|
|
|
|
*/ |
|
|
|
|
public function wipeUserDevices(string $userId): DataResponse { |
|
|
|
|
/** @var IUser $currentLoggedInUser */ |
|
|
|
@ -1111,6 +1129,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID of the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User deleted successfully |
|
|
|
|
*/ |
|
|
|
|
public function deleteUser(string $userId): DataResponse { |
|
|
|
|
$currentLoggedInUser = $this->userSession->getUser(); |
|
|
|
@ -1148,6 +1168,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID of the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User disabled successfully |
|
|
|
|
*/ |
|
|
|
|
public function disableUser(string $userId): DataResponse { |
|
|
|
|
return $this->setEnabled($userId, false); |
|
|
|
@ -1162,6 +1184,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID of the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User enabled successfully |
|
|
|
|
*/ |
|
|
|
|
public function enableUser(string $userId): DataResponse { |
|
|
|
|
return $this->setEnabled($userId, true); |
|
|
|
@ -1201,6 +1225,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID of the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array{groups: string[]}, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: Users groups returned |
|
|
|
|
*/ |
|
|
|
|
public function getUsersGroups(string $userId): DataResponse { |
|
|
|
|
$loggedInUser = $this->userSession->getUser(); |
|
|
|
@ -1249,6 +1275,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $groupid ID of the group |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User added to group successfully |
|
|
|
|
*/ |
|
|
|
|
public function addToGroup(string $userId, string $groupid = ''): DataResponse { |
|
|
|
|
if ($groupid === '') { |
|
|
|
@ -1286,6 +1314,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $groupid ID of the group |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User removed from group successfully |
|
|
|
|
*/ |
|
|
|
|
public function removeFromGroup(string $userId, string $groupid): DataResponse { |
|
|
|
|
$loggedInUser = $this->userSession->getUser(); |
|
|
|
@ -1349,6 +1379,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $groupid ID of the group |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User added as group subadmin successfully |
|
|
|
|
*/ |
|
|
|
|
public function addSubAdmin(string $userId, string $groupid): DataResponse { |
|
|
|
|
$group = $this->groupManager->get($groupid); |
|
|
|
@ -1387,6 +1419,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $groupid ID of the group |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User removed as group subadmin successfully |
|
|
|
|
*/ |
|
|
|
|
public function removeSubAdmin(string $userId, string $groupid): DataResponse { |
|
|
|
|
$group = $this->groupManager->get($groupid); |
|
|
|
@ -1417,6 +1451,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID if the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, string[], array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: User subadmin groups returned |
|
|
|
|
*/ |
|
|
|
|
public function getUserSubAdminGroups(string $userId): DataResponse { |
|
|
|
|
$groups = $this->getUserSubAdminGroupsData($userId); |
|
|
|
@ -1432,6 +1468,8 @@ class UsersController extends AUserData { |
|
|
|
|
* @param string $userId ID if the user |
|
|
|
|
* @return DataResponse<Http::STATUS_OK, array<empty>, array{}> |
|
|
|
|
* @throws OCSException |
|
|
|
|
* |
|
|
|
|
* 200: Resent welcome message successfully |
|
|
|
|
*/ |
|
|
|
|
public function resendWelcomeMessage(string $userId): DataResponse { |
|
|
|
|
$currentLoggedInUser = $this->userSession->getUser(); |
|
|
|
|