mirror of
https://github.com/openvk/openvk
synced 2025-07-07 16:29:50 +03:00
Groups: Transfer community permissions to another user
Groups: Transfer community permissions to another user (Issue #302 )
This commit is contained in:
parent
bc832ece64
commit
17937432bc
5 changed files with 30 additions and 0 deletions
|
@ -269,4 +269,20 @@ final class GroupPresenter extends OpenVKPresenter
|
|||
$this->notFound();
|
||||
}
|
||||
}
|
||||
|
||||
function renderChangeOwner(int $id, int $newOwnerID): void
|
||||
{
|
||||
$this->assertUserLoggedIn();
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$club = $this->clubs->get($id);
|
||||
$newOwner = (new Users)->get($newOwnerID);
|
||||
if($this->user->id !== $club->getOwner()->getId())
|
||||
$this->flashFail("err", tr("error"), tr("forbidden"));
|
||||
|
||||
$club->setOwner($newOwnerID);
|
||||
$club->save();
|
||||
|
||||
$this->flashFail("succ", tr("information_-1"), tr("group_owner_setted", $newOwner->getCanonicalName(), $club->getName()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,6 +91,12 @@
|
|||
{_promote_to_admin}
|
||||
{/if}
|
||||
</a>
|
||||
{if $club->getOwner()->getId() != $user->getId() && $manager && $thisUser->getId() == $club->getOwner()->getId()}
|
||||
|
|
||||
<a href="/groups/{$club->getId()}/setNewOwner/{$user->getId()}">
|
||||
{_promote_to_owner}
|
||||
</a>
|
||||
{/if}
|
||||
{if $manager}
|
||||
|
|
||||
<a href="javascript:setClubAdminComment('{$club->getId()}', '{$manager->getUserId()}', '{rawurlencode($csrfToken)}')">
|
||||
|
|
|
@ -73,6 +73,8 @@ routes:
|
|||
handler: "Group->attend"
|
||||
- url: "/al_comments.pl/create/{text}/{num}"
|
||||
handler: "Comment->makeComment"
|
||||
- url: "/groups/{num}/setNewOwner/{num}"
|
||||
handler: "Group->changeOwner"
|
||||
- url: "/comment{num}/like"
|
||||
handler: "Comment->like"
|
||||
- url: "/comment{num}/delete"
|
||||
|
|
|
@ -229,6 +229,7 @@
|
|||
"role" = "Role";
|
||||
"administrator" = "Administrator";
|
||||
"promote_to_admin" = "Promote to admin";
|
||||
"promote_to_owner" = "Promote to owner";
|
||||
"devote" = "Devote";
|
||||
"set_comment" = "Set comment";
|
||||
"hidden_yes" = "Hidden: Yes";
|
||||
|
@ -240,6 +241,8 @@
|
|||
"group_display_all_administrators" = "Display all administrators";
|
||||
"group_dont_display_administrators_list" = "Display nothing";
|
||||
|
||||
"group_owner_setted" = "New owner ($1) has been successfully assigned to community $2. If you want to return the community, please contact the technical support of the site.";
|
||||
|
||||
"participants_zero" = "No participants";
|
||||
"participants_one" = "$1 participant";
|
||||
"participants_other" = "$1 participant";
|
||||
|
|
|
@ -239,6 +239,7 @@
|
|||
"role" = "Роль";
|
||||
"administrator" = "Администратор";
|
||||
"promote_to_admin" = "Повысить до администратора";
|
||||
"promote_to_owner" = "Назначить владельцем";
|
||||
"devote" = "Разжаловать";
|
||||
"set_comment" = "Изменить комментарий";
|
||||
"hidden_yes" = "Скрыт: Да";
|
||||
|
@ -250,6 +251,8 @@
|
|||
"group_display_all_administrators" = "Отображать всех администраторов";
|
||||
"group_dont_display_administrators_list" = "Ничего не отображать";
|
||||
|
||||
"group_owner_setted" = "Новый владелец ($1) успешно назначен в сообщество $2. Если Вы хотите вернуть сообщество, обратитесь в техническую поддержку сайта.";
|
||||
|
||||
"participants_zero" = "Ни одного участника";
|
||||
"participants_one" = "Один участник";
|
||||
"participants_few" = "$1 участника";
|
||||
|
|
Loading…
Reference in a new issue