add test_client_hash

This commit is contained in:
Andrey Kuvshinov
2020-05-29 20:34:26 +03:00
parent fb7ab18053
commit 803dc29d37
3 changed files with 29 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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 ){

View File

@@ -4,6 +4,7 @@
<?if ($checklogin['error'] == 'client not found'):?>
<a href="<?=SITE?>login">Войти</a>
<?else:?>
<?=$checklogin['clientmail']?>
<a href="<?=SITE?>out">Выйти</a>
<?endif?>
</div>