mirror of
https://github.com/humhub/humhub.git
synced 2025-03-14 20:19:47 +01:00
Fixed #1205: Space remove member broken
This commit is contained in:
parent
50066e7c69
commit
72a8881f1a
@ -201,18 +201,18 @@ class AdminController extends \humhub\modules\content\components\ContentContaine
|
||||
{
|
||||
$this->forcePostRequest();
|
||||
|
||||
$workspace = $this->getSpace();
|
||||
$space = $this->getSpace();
|
||||
$userGuid = Yii::$app->request->get('userGuid');
|
||||
$user = User::model()->findByAttributes(array('guid' => $userGuid));
|
||||
$user = User::findOne(array('guid' => $userGuid));
|
||||
|
||||
if ($workspace->isSpaceOwner($user->id)) {
|
||||
throw new CHttpException(500, 'Owner cannot be removed!');
|
||||
if ($space->isSpaceOwner($user->id)) {
|
||||
throw new HttpException(500, 'Owner cannot be removed!');
|
||||
}
|
||||
|
||||
$workspace->removeMember($user->id);
|
||||
$space->removeMember($user->id);
|
||||
|
||||
// Redirect back to Administration page
|
||||
$this->htmlRedirect($this->createUrl('//space/admin/members', array('sguid' => $workspace->guid)));
|
||||
return $this->htmlRedirect($space->createUrl('/space/admin/members'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -129,7 +129,7 @@ use humhub\modules\space\models\Space;
|
||||
'buttonFalse' => Yii::t('SpaceModule.views_admin_members', 'No, cancel'),
|
||||
'cssClass' => 'btn btn-sm btn-danger',
|
||||
'linkContent' => Yii::t('SpaceModule.views_admin_members', 'Remove'),
|
||||
'linkHref' => $space->createUrl('//space/admin/removeMember', array('userGuid' => $user->guid, 'ajax' => 1))
|
||||
'linkHref' => $space->createUrl('/space/admin/remove-member', array('userGuid' => $user->guid, 'ajax' => 1))
|
||||
));
|
||||
?>
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user