From 803dc29d37b929f7f4912a1825db8d2fb8b33e3a Mon Sep 17 00:00:00 2001 From: Andrey Kuvshinov Date: Fri, 29 May 2020 20:34:26 +0300 Subject: [PATCH] add test_client_hash --- app/routes/auth.php | 10 ++++++++++ app/routes/client.php | 18 ++++++++++++++++++ app/views/blocks/auth.phtml | 1 + 3 files changed, 29 insertions(+) diff --git a/app/routes/auth.php b/app/routes/auth.php index d7f6fab..4981926 100644 --- a/app/routes/auth.php +++ b/app/routes/auth.php @@ -92,8 +92,16 @@ function redirect_login(){ } +//имитируем заход под юзером +function test_client_hash_kuri($hash){ + $client = client_find_hash($hash); + if (isset($client['error'])) { + add_user_cookie($client['client_id'], $result['clientpassword']); + } + +} // if(password_verify($_POST["password"],$hashed_password)) @@ -113,6 +121,8 @@ function resetpwd_kuri($hash){ } else if ($client['clientpassword'] !== ''){ $error = 'Пароль уже был изменен'; + + $viewform = False; } diff --git a/app/routes/client.php b/app/routes/client.php index bdaffdc..8c2b8c4 100644 --- a/app/routes/client.php +++ b/app/routes/client.php @@ -136,6 +136,24 @@ function mybooks_kuri($category = 'gazeta', $filter = 'all', $page = 1){ +function books_client_kuri($id){ + + $login = check_login_kuri(); + + + if (!isset($login['client_id'])){ + header('Location: '.SITE.'login'); + exit; + } + + + + + +} + + + //все покупки function payments_kuri($filter = 1 ){ diff --git a/app/views/blocks/auth.phtml b/app/views/blocks/auth.phtml index c69533e..9b6daee 100644 --- a/app/views/blocks/auth.phtml +++ b/app/views/blocks/auth.phtml @@ -4,6 +4,7 @@ Войти + Выйти \ No newline at end of file