mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
Global: New route for theme reset
Will be useful for themes such as "OpenVK Mobile".
This commit is contained in:
parent
28c66af133
commit
de1857388d
2 changed files with 18 additions and 0 deletions
|
@ -481,6 +481,22 @@ final class UserPresenter extends OpenVKPresenter
|
|||
$this->flashFail("succ", tr("information_-1"), tr("two_factor_authentication_disabled_message"));
|
||||
}
|
||||
|
||||
function renderResetThemepack(): void
|
||||
{
|
||||
$this->assertNoCSRF();
|
||||
|
||||
$this->setSessionTheme(Themepacks::DEFAULT_THEME_ID);
|
||||
|
||||
if($this->user) {
|
||||
$this->willExecuteWriteAction();
|
||||
|
||||
$this->user->identity->setStyle(Themepacks::DEFAULT_THEME_ID);
|
||||
$this->user->identity->save();
|
||||
}
|
||||
|
||||
$this->redirect("/", static::REDIRECT_TEMPORARY_PRESISTENT);
|
||||
}
|
||||
|
||||
function renderCoinsTransfer(): void
|
||||
{
|
||||
$this->assertUserLoggedIn();
|
||||
|
|
|
@ -71,6 +71,8 @@ routes:
|
|||
handler: "User->twoFactorAuthSettings"
|
||||
- url: "/settings/2fa/disable"
|
||||
handler: "User->disableTwoFactorAuth"
|
||||
- url: "/settings/reset_theme"
|
||||
handler: "User->resetThemepack"
|
||||
- url: "/coins_transfer"
|
||||
handler: "User->coinsTransfer"
|
||||
- url: "/increase_social_credits"
|
||||
|
|
Loading…
Reference in a new issue