This commit is contained in:
4 files changed
+37
-60
No files matched your search
@@ -96,6 +96,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
$communityMember = new CommunityMember();
|
||||
$communityMember->setCommunity($community);
|
||||
$communityMember->setUser($user);
|
||||
$communityMember->setOwner((bool)\Container::$request->post('owner'));
|
||||
\Container::$persistentDataManager->saveToDb($communityMember);
|
||||
|
||||
return new JsonContent(['success' => true]);
|
||||
@@ -107,14 +108,14 @@ class CommunityController implements IAuthenticationRequired
|
||||
return null;
|
||||
}
|
||||
|
||||
$communityMember = $this->communityMemberRepository->getById(\Container::$request->post('community_member_id'));
|
||||
$communityMember = $this->communityMemberRepository->getById(\Container::$request->query('community_member_id'));
|
||||
if ($communityMember->getUserId() === \Container::$request->user()->getUniqueId()) {
|
||||
return new JsonContent([
|
||||
'error' => ['errorText' => 'Own user cannot be edited.']
|
||||
]);
|
||||
}
|
||||
|
||||
$communityMember->setOwner(\Container::$request->post('owner'));
|
||||
$communityMember->setOwner((bool)\Container::$request->post('owner'));
|
||||
\Container::$persistentDataManager->saveToDb($communityMember);
|
||||
|
||||
return new JsonContent(['success' => true]);
|
||||
@@ -126,7 +127,7 @@ class CommunityController implements IAuthenticationRequired
|
||||
return null;
|
||||
}
|
||||
|
||||
$communityMember = $this->communityMemberRepository->getById(\Container::$request->post('community_member_id'));
|
||||
$communityMember = $this->communityMemberRepository->getById(\Container::$request->query('community_member_id'));
|
||||
if ($communityMember->getUserId() === \Container::$request->user()->getUniqueId()) {
|
||||
return new JsonContent([
|
||||
'error' => ['errorText' => 'Own user cannot be deleted.']
|
||||
|
||||
Reference in new issue
Block a user