correct auth block

This commit is contained in:
Andrey Kuvshinov
2020-05-12 21:34:52 +03:00
parent 9b1b62b988
commit 253a03b91f
3 changed files with 6 additions and 6 deletions

View File

@@ -30,10 +30,10 @@ function login_kuri(){
function out_kuri(){ function out_kuri(){
unset($_COOKIE['user']); unset($_COOKIE['user']);
setcookie('user', null, -1); setcookie('user', null, -1,'/', $_SERVER['HTTP_HOST']);
unset($_COOKIE['pwd']); unset($_COOKIE['pwd']);
setcookie('pwd', null, -1); setcookie('pwd', null, -1, '/', $_SERVER['HTTP_HOST']);
header('Location: '.SITE.'login'); header('Location: '.SITE.'login');

View File

@@ -85,8 +85,8 @@ function mybooks_kuri($page = 1){
$login = check_login_kuri(); $login = check_login_kuri();
if (!isset($login['data']['clienthash'])){ if (!isset($login['data']['clienthash'])){
// header('Location: '.SITE.'login'); header('Location: '.SITE.'login');
// exit; exit;
} }
$limit = 25; $limit = 25;

View File

@@ -1,6 +1,6 @@
<?$checklogin = check_login_kuri()?> <?$checklogin = check_login_kuri();?>
<div id="auth"> <div id="auth">
<?if ($checklogin == 'error'):?> <?if ($checklogin['error'] == 'client not found'):?>
<a href="<?=SITE?>login">Войти</a> <a href="<?=SITE?>login">Войти</a>
<?else:?> <?else:?>
<a href="<?=SITE?>mybooks">Моя библиотека</a> / <a href="<?=SITE?>mybooks">Моя библиотека</a> /