From bcd851627ee573ba171b2bc07b5c290b5de94fcd Mon Sep 17 00:00:00 2001 From: "ns.potapov" Date: Wed, 29 May 2024 14:23:16 +0400 Subject: [PATCH] =?UTF-8?q?=D0=A1=D0=B4=D0=B5=D0=BB=D0=B0=D0=BB=20=D1=88?= =?UTF-8?q?=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=20=D0=B4=D0=BB=D1=8F=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=87=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=B0=D0=B1=D0=B8?= =?UTF-8?q?=D0=BD=D0=B5=D1=82=D0=B0=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D1=82=D0=B5=D0=BB=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UserController.cs | 11 +++++++++++ .../PolyclinicWebAppImplementer/SiteMenuItems.cs | 2 +- .../Views/Home/Privacy.cshtml | 6 ------ .../Views/Shared/_Layout.cshtml | 3 +-- .../Views/User/Privacy.cshtml | 6 ++++++ 5 files changed, 19 insertions(+), 9 deletions(-) delete mode 100644 Polyclinic/PolyclinicWebAppImplementer/Views/Home/Privacy.cshtml create mode 100644 Polyclinic/PolyclinicWebAppImplementer/Views/User/Privacy.cshtml diff --git a/Polyclinic/PolyclinicWebAppImplementer/Controllers/UserController.cs b/Polyclinic/PolyclinicWebAppImplementer/Controllers/UserController.cs index 3748432..2e5021a 100644 --- a/Polyclinic/PolyclinicWebAppImplementer/Controllers/UserController.cs +++ b/Polyclinic/PolyclinicWebAppImplementer/Controllers/UserController.cs @@ -94,5 +94,16 @@ namespace PolyclinicWebAppImplementer.Controllers LoginManager.LogginedUser = null; return RedirectToAction("Login"); } + + [HttpGet] + [HttpPost] + public IActionResult Privacy() + { + if (LoginManager.LogginedUser == null) + { + return RedirectToAction("Login"); + } + return View(); + } } } diff --git a/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs b/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs index 70b305a..4d1e0b3 100644 --- a/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs +++ b/Polyclinic/PolyclinicWebAppImplementer/SiteMenuItems.cs @@ -8,7 +8,7 @@ public static (string Controller, string Action, string Title, PageVisible Visible) Symptomes = ("Symptomes", "", "Симптомы", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) Login = ("User", "Login", "Вход", PageVisible.AllowOnlyNotAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) Register = ("User", "Register", "Регистрация", PageVisible.AllowOnlyNotAuthorized); - public static (string Controller, string Action, string Title, PageVisible Visible) Privacy = ("Home", "Privacy", "Политика приватности", PageVisible.AllowAnyBody); + public static (string Controller, string Action, string Title, PageVisible Visible) Privacy = ("User", "Privacy", "Личный кабинет", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) AddRecipeToCourse = ("Home", "AddRecipeToCourse", "Привязка рецепта", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) MedicamentsByDiagnoses = ("Home", "MedicamentsByDiagnoses", "Лекарства по болезням", PageVisible.AllowOnlyAuthorized); public static (string Controller, string Action, string Title, PageVisible Visible) DiagnosesReport = ("Home", "DiagnosesReport", "Отчет по болезням", PageVisible.AllowOnlyAuthorized); diff --git a/Polyclinic/PolyclinicWebAppImplementer/Views/Home/Privacy.cshtml b/Polyclinic/PolyclinicWebAppImplementer/Views/Home/Privacy.cshtml deleted file mode 100644 index ce65fcc..0000000 --- a/Polyclinic/PolyclinicWebAppImplementer/Views/Home/Privacy.cshtml +++ /dev/null @@ -1,6 +0,0 @@ -@{ - ViewBag.SelectedSiteMenuItem = SiteMenuItems.Privacy; -} -

Политика приватности

- -

Здесь нет никакой приватности

diff --git a/Polyclinic/PolyclinicWebAppImplementer/Views/Shared/_Layout.cshtml b/Polyclinic/PolyclinicWebAppImplementer/Views/Shared/_Layout.cshtml index 3550179..70f67e7 100644 --- a/Polyclinic/PolyclinicWebAppImplementer/Views/Shared/_Layout.cshtml +++ b/Polyclinic/PolyclinicWebAppImplementer/Views/Shared/_Layout.cshtml @@ -71,8 +71,7 @@ diff --git a/Polyclinic/PolyclinicWebAppImplementer/Views/User/Privacy.cshtml b/Polyclinic/PolyclinicWebAppImplementer/Views/User/Privacy.cshtml new file mode 100644 index 0000000..5eb56c8 --- /dev/null +++ b/Polyclinic/PolyclinicWebAppImplementer/Views/User/Privacy.cshtml @@ -0,0 +1,6 @@ +@{ + ViewBag.SelectedSiteMenuItem = SiteMenuItems.Privacy; +} +

Личный кабинет

+ +

Здесь будут данные пользователя