add base href

This commit is contained in:
Andrey Kuvshinov
2020-05-12 22:56:44 +03:00
parent 9b78944dcb
commit c8c7b598c7
8 changed files with 36 additions and 34 deletions

View File

@@ -126,7 +126,8 @@ function client_check_auth($login, $pwd){
return ['error' => 'client not found']; return ['error' => 'client not found'];
} }
$hash_pwd = md5($login.$client['clientpassword']); $hash_pwd = client_secret($client['client_id'], $client['clientpassword']);
if ($pwd == $hash_pwd){ if ($pwd == $hash_pwd){
return ['data' => $client]; return ['data' => $client];
@@ -138,6 +139,11 @@ function client_check_auth($login, $pwd){
} }
function client_secret($id, $password){
return md5($id.$password);
}
function client_add_password($client_id, $password, $confirm, $minlen = 5){ function client_add_password($client_id, $password, $confirm, $minlen = 5){

View File

@@ -118,24 +118,6 @@ h1 {
position:relative; position:relative;
} }
#container_form{
width:450px;
height: 500px;
background-color: rgba(24, 33, 52, 0.7);
margin: 250px auto 0 auto;
text-align: center;
box-shadow: 0 -5px 0 #3adbfd;
}
input[type="text"],input[type="password"], input[type="email"]{
width: 300px;
height:50px;
font-size: 18px;
margin-bottom: 25px;
border-radius: 4px;
padding-left: 10px;
}
@media screen and (max-width: 560px) { @media screen and (max-width: 560px) {

View File

@@ -11,7 +11,7 @@ function anpromo_kuri($page = 1, $scale = 1){
$file = SITEPATH.'pub/files/source/742.pdf'; $file = SITEPATH.'pub/files/source/742.pdf';
$data = pdfs_init($file, $page); $data = pdfs_init($file, $page);
$pdfile = $data['pdfpgurl']; $pdfile = SITE.$data['pdfpgurl'];
$fullpdf = $data['pdfurl']; $fullpdf = $data['pdfurl'];

View File

@@ -19,6 +19,10 @@ function login_kuri(){
} }
// if (isset($_COOKIE['chitatel'])){
// out();
// }
$tempcontent = VIEWPATH.'login.phtml'; $tempcontent = VIEWPATH.'login.phtml';
include VIEWPATH.'layout_lite.phtml'; include VIEWPATH.'layout_lite.phtml';
@@ -29,11 +33,15 @@ function login_kuri(){
function out_kuri(){ function out_kuri(){
unset($_COOKIE['user']); if (isset($_COOKIE['chitatel'])) {
setcookie('user', null, -1,'/'); unset($_COOKIE['chitatel']);
setcookie('chitatel', null, -1,'/', $_SERVER['HTTP_HOST']);
}
unset($_COOKIE['pwd']); if (isset($_COOKIE['code'])) {
setcookie('pwd', null, -1, '/'); unset($_COOKIE['code']);
setcookie('code', null, -1, '/', $_SERVER['HTTP_HOST']);
}
header('Location: '.SITE.'login'); header('Location: '.SITE.'login');
@@ -48,8 +56,10 @@ function add_user_cookie($user, $pwd){
// ini_set ("session.use_trans_sid", true); // ini_set ("session.use_trans_sid", true);
// session_start(); // session_start();
setcookie ("user", $user, $timeout, '/'); $secret = client_secret($user, $pwd);
setcookie ("pwd", md5($user.$pwd), $timeout, '/');
setcookie ("chitatel", $user, $timeout, '/', $_SERVER['HTTP_HOST']);
setcookie ("code", $secret, $timeout, '/', $_SERVER['HTTP_HOST']);
} }
@@ -59,7 +69,7 @@ function check_login_kuri(){
//ini_set ("session.use_trans_sid", true); //ini_set ("session.use_trans_sid", true);
//session_start(); //session_start();
$client = client_check_auth($_COOKIE['user'], $_COOKIE['pwd']); $client = client_check_auth($_COOKIE['chitatel'], $_COOKIE['code']);
if (!isset($client['data'])){ if (!isset($client['data'])){
return $client; return $client;

View File

@@ -84,11 +84,14 @@ function mybooks_kuri($page = 1){
$login = check_login_kuri(); $login = check_login_kuri();
if (!isset($login['data']['clienthash'])){
header('Location: '.SITE.'login'); if (!isset($login['client_id'])){
exit; header('Location: '.SITE.'login');
exit;
} }
$limit = 25; $limit = 25;
$client = api_client_kuri($login['data']['clienthash']); $client = api_client_kuri($login['data']['clienthash']);
$baseurl = SITE."mybooks/"; $baseurl = SITE."mybooks/";

View File

@@ -1,9 +1,10 @@
<html> <html>
<head> <head>
<title>Еженедельник Аргументы Недели - <?=$title?></title> <title>Еженедельник Аргументы Недели - <?=$title?></title>
<//base href="<?=SITE?>">
<script src="/pub/scripts/pdf.min.js"></script> <script src="/pub/scripts/pdf.min.js"></script>
<script src="/pub/scripts/anviewer.js?ver=43"></script> <script src="/pub/scripts/anviewer.js?ver=43"></script>
<link rel="stylesheet" type="text/css" href="/pub/css/an.css?ver=39"> <link rel="stylesheet" type="text/css" href="/pub/css/an.css?ver=40">
<link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico"> <link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="/pub/fontawesome/css/all.css"> <link rel="stylesheet" href="/pub/fontawesome/css/all.css">

View File

@@ -4,7 +4,7 @@
<p><label for="username">Вход в личный кабинет</label></p> <p><label for="username">Вход в личный кабинет</label></p>
<p><input name="username" type="email" autocomplete="on" placeholder="Введите электронную почту"/></p> <p><input name="username" type="email" autocomplete="on" placeholder="Введите электронную почту"/></p>
<p><input name="password" type="password" minlength="5" autocomplete="current-password" placeholder="Введите пароль"></p> <p><input name="password" type="password" minlength="5" autocomplete="current-password" placeholder="Введите пароль"></p>
<p><input type="submit" value="ВОЙТИ"></p> <p><input class="submit" type="submit" value="ВОЙТИ"></p>
</form> </form>
<?if (isset($error)):?> <?if (isset($error)):?>

View File

@@ -4,7 +4,7 @@
<p><label for="new-password">Придумайте пароль не менее 5 символов и повторите его для подтверждения:</label></p> <p><label for="new-password">Придумайте пароль не менее 5 символов и повторите его для подтверждения:</label></p>
<p><input name="new-password" id="new-password" type="password" autocomplete="new-password" minlength="<?=$minlen?>" placeholder="Введите пароль" required /></p> <p><input name="new-password" id="new-password" type="password" autocomplete="new-password" minlength="<?=$minlen?>" placeholder="Введите пароль" required /></p>
<p><input name="confirm-password" id="confirm-password" type="password" autocomplete="new-password" minlength="<?=$minlen?>" placeholder="Повторите пароль" required /></pdf> <p><input name="confirm-password" id="confirm-password" type="password" autocomplete="new-password" minlength="<?=$minlen?>" placeholder="Повторите пароль" required /></pdf>
<p><input name="reset-submit" type="submit" value="Сохранить пароль"></p> <p><input name="reset-submit" class="submit" type="submit" value="Сохранить пароль"></p>
</form> </form>
<?endif?> <?endif?>