diff --git a/app/api/apiclient.php b/app/api/apiclient.php index 2f1c8db..e090449 100644 --- a/app/api/apiclient.php +++ b/app/api/apiclient.php @@ -142,7 +142,9 @@ function client_check_auth($login, $pwd){ function client_secret($id, $password){ - return md5($id.$password); + $secret = md5($id.$password); + //echo "$id + $password = $secret
"; + return $secret; } @@ -169,7 +171,7 @@ function client_add_password($client_id, $password, $confirm, $minlen = 5){ - return True; + return ['newpassword' => $clientpassword]; } diff --git a/app/routes/auth.php b/app/routes/auth.php index abe462c..d7f6fab 100644 --- a/app/routes/auth.php +++ b/app/routes/auth.php @@ -119,8 +119,8 @@ function resetpwd_kuri($hash){ if (isset($_POST['reset-submit'])){ //пришла форма $result = client_add_password($client['client_id'], $_POST['new-password'], $_POST['confirm-password'], $minlen); - if ($result){ - add_user_cookie($client['client_id'], $_POST['new-password']); + if (isset($result['newpassword'])){ + add_user_cookie($client['client_id'], $result['newpassword']); $linklab = SITE.'mybooks'; $viewform = False; } diff --git a/app/views/allbooks.phtml b/app/views/allbooks.phtml index 8967969..cf30b01 100644 --- a/app/views/allbooks.phtml +++ b/app/views/allbooks.phtml @@ -11,7 +11,7 @@
-

+

diff --git a/app/views/login.phtml b/app/views/login.phtml index f0a0f90..8b8e207 100644 --- a/app/views/login.phtml +++ b/app/views/login.phtml @@ -2,8 +2,8 @@

-

-

+

+

diff --git a/app/views/reset.phtml b/app/views/reset.phtml index 52a68fe..db2cb3a 100644 --- a/app/views/reset.phtml +++ b/app/views/reset.phtml @@ -2,7 +2,7 @@

-

+