diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index c93b1820..7c432561 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -85,6 +85,11 @@ class User extends RowModel { return (bool) $this->getRecord()->microblog; } + + function getMainPage(): int + { + return $this->getRecord()->main_page; + } function getChandlerGUID(): string { diff --git a/Web/Presenters/AboutPresenter.php b/Web/Presenters/AboutPresenter.php index 9ec6c770..3caa007d 100644 --- a/Web/Presenters/AboutPresenter.php +++ b/Web/Presenters/AboutPresenter.php @@ -14,7 +14,12 @@ final class AboutPresenter extends OpenVKPresenter { if(!is_null($this->user)) { header("HTTP/1.1 302 Found"); - header("Location: /id" . $this->user->id); + + if($this->user->identity->getMainPage()) + header("Location: /feed"); + else + header("Location: /id" . $this->user->id); + exit; } diff --git a/Web/Presenters/UserPresenter.php b/Web/Presenters/UserPresenter.php index 7cdfe397..c6a41616 100644 --- a/Web/Presenters/UserPresenter.php +++ b/Web/Presenters/UserPresenter.php @@ -419,6 +419,9 @@ final class UserPresenter extends OpenVKPresenter if(in_array($this->postParam("nsfw"), [0, 1, 2])) $user->setNsfwTolerance((int) $this->postParam("nsfw")); + + if(in_array($this->postParam("main_page"), [0, 1])) + $user->setMain_Page((int) $this->postParam("main_page")); } else if($_GET['act'] === "lMenu") { $settings = [ "menu_bildoj" => "photos", diff --git a/Web/Presenters/templates/User/Settings.xml b/Web/Presenters/templates/User/Settings.xml index 12f6a71c..1437d1a3 100644 --- a/Web/Presenters/templates/User/Settings.xml +++ b/Web/Presenters/templates/User/Settings.xml @@ -500,6 +500,17 @@ +