add auth
This commit is contained in:
9
app/views/blocks/auth.phtml
Normal file
9
app/views/blocks/auth.phtml
Normal file
@@ -0,0 +1,9 @@
|
||||
<?$checklogin = check_login_kuri()?>
|
||||
<div id="auth">
|
||||
<?if ($checklogin == 'error'):?>
|
||||
<a href="login">Войти</a>
|
||||
<?else:?>
|
||||
<a href="mybooks">Моя библиотека</a> /
|
||||
<a href="out">Выйти</a>
|
||||
<?endif?>
|
||||
</div>
|
||||
@@ -3,7 +3,7 @@
|
||||
<title>Еженедельник Аргументы Недели - <?=$title?></title>
|
||||
<script src="/pub/scripts/pdf.min.js"></script>
|
||||
<script src="/pub/scripts/anviewer.js?ver=43"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/pub/css/an.css?ver=37">
|
||||
<link rel="stylesheet" type="text/css" href="/pub/css/an.css?ver=39">
|
||||
<link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/pub/fontawesome/css/all.css">
|
||||
@@ -55,6 +55,7 @@ _tmr.push({id: "1069168", type: "pageView", start: (new Date()).getTime()});
|
||||
<h1>
|
||||
<a id="brand_title" href="https://argumenti.ru/"><span id="redb">А</span>ргументы <span id="redb">Н</span>едел<span id="redi">i</span></a> → <a id="page_title" href="<?=$baseurl?>"><?=$title?></a>
|
||||
</h1>
|
||||
<?include('blocks/auth.phtml')?>
|
||||
<div class="adv">
|
||||
<!-- Yandex.RTB R-A-50615-61 -->
|
||||
<div id="yandex_rtb_R-A-50615-61"></div>
|
||||
|
||||
27
app/views/layout_lite.phtml
Normal file
27
app/views/layout_lite.phtml
Normal file
@@ -0,0 +1,27 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Еженедельник Аргументы Недели - <?=$title?></title>
|
||||
<script src="/pub/scripts/pdf.min.js"></script>
|
||||
<script src="/pub/scripts/anviewer.js?ver=43"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/pub/css/an.css?ver=37">
|
||||
<link rel="icon" type="image/ico" href="https://argumenti.ru/favicon.ico">
|
||||
<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/v4-shims.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
|
||||
<h1>
|
||||
<a id="brand_title" href="https://argumenti.ru/"><span id="redb">А</span>ргументы <span id="redb">Н</span>едел<span id="redi">i</span></a> → <a id="page_title" href="<?=$baseurl?>"><?=$title?></a>
|
||||
</h1>
|
||||
|
||||
|
||||
<?if (isset($tempcontent))
|
||||
include($tempcontent);
|
||||
?>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
14
app/views/login.phtml
Normal file
14
app/views/login.phtml
Normal file
@@ -0,0 +1,14 @@
|
||||
<div id="container_form">
|
||||
|
||||
<form method="POST" action="login">
|
||||
<p><label for="username">Вход в личный кабинет</label></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 type="submit" value="ВОЙТИ"></p>
|
||||
</form>
|
||||
|
||||
<?if (isset($error)):?>
|
||||
<div id="error" style="color: red;"><?=$error?></div>
|
||||
<?endif?>
|
||||
|
||||
</div>
|
||||
@@ -1,10 +1,18 @@
|
||||
<form method="POST" action="<?=$url?>">
|
||||
<p>Придумайте пароль не менее 5 символов</p>
|
||||
<p>Пароль:<input name="pass" type="password" required></p>
|
||||
<p>Повторить:<input name="pass2" type="password" required></p>
|
||||
<input name="submit" type="submit" value="Сохранить пароль">
|
||||
</form>
|
||||
<?if ($viewform):?>
|
||||
|
||||
<?if (isset($result)):?>
|
||||
<div id="error" style="color: red;"><?=$result?></div>
|
||||
<?endif?>
|
||||
<form method="POST" action="<?=$url?>">
|
||||
<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="confirm-password" id="confirm-password" type="password" autocomplete="new-password" minlength="<?=$minlen?>" placeholder="Повторите пароль" required /></pdf>
|
||||
<p><input name="reset-submit" type="submit" value="Сохранить пароль"></p>
|
||||
</form>
|
||||
|
||||
<?endif?>
|
||||
|
||||
<?if (isset($error)):?>
|
||||
<div id="error" style="color: red;"><?=$error?></div>
|
||||
<?endif?>
|
||||
|
||||
<?if (isset($linklab)):?>
|
||||
<div id="info">Сохраните пароль в вашем браузере, чтобы каждый раз не вводить его вручную.<br>Ваша библиотека доступна по адресу <a href="<?=$linklab?>"><?=$linklab?></a></div>
|
||||
<?endif?>
|
||||
Reference in New Issue
Block a user