This repository has been archived by the owner on Sep 30, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathupdatelist.php
209 lines (166 loc) · 8.69 KB
/
updatelist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?php
include('DB.php');
function isLoggedIn() {
if (isset($_COOKIE['SNID'])) {
if (DB::query('SELECT user_id FROM login_tokens WHERE token=:token', array(':token'=>sha1($_COOKIE['SNID'])))) {
$userid = DB::query('SELECT user_id FROM login_tokens WHERE token=:token', array(':token'=>sha1($_COOKIE['SNID'])))[0]['user_id'];
if (isset($_COOKIE['SNID_'])) {
return $userid;
} else {
$cstrong = True;
$token = bin2hex(openssl_random_pseudo_bytes(64, $cstrong));
DB::query('INSERT INTO login_tokens VALUES (\'0\', :token, :user_id)', array(':token'=>sha1($token), ':user_id'=>$userid));
DB::query('DELETE FROM login_tokens WHERE token=:token', array(':token'=>sha1($_COOKIE['SNID'])));
setcookie("SNID", $token, time() + 60 * 60 * 24 * 7, '/', NULL, NULL, TRUE);
setcookie("SNID_", '1', time() + 60 * 60 * 24 * 3, '/', NULL, NULL, TRUE);
return $userid;
}
}
}
return false;
}
function getUsername() {
if (isset($_COOKIE['SNID'])) {
if (DB::query('SELECT username FROM login_tokens WHERE token=:token', array(':token'=>sha1($_COOKIE['SNID'])))) {
$username = DB::query('SELECT username FROM login_tokens WHERE token=:token', array(':token'=>sha1($_COOKIE['SNID'])))[0]['username'];
if (isset($_COOKIE['SNID_'])) {
return $username;
} else {
$cstrong = True;
$token = bin2hex(openssl_random_pseudo_bytes(64, $cstrong));
DB::query('INSERT INTO login_tokens VALUES (\'0\', :token, :user_id)', array(':token'=>sha1($token), ':username'=>$username));
DB::query('DELETE FROM login_tokens WHERE token=:token', array(':token'=>sha1($_COOKIE['SNID'])));
setcookie("SNID", $token, time() + 60 * 60 * 24 * 7, '/', NULL, NULL, TRUE);
setcookie("SNID_", '1', time() + 60 * 60 * 24 * 3, '/', NULL, NULL, TRUE);
return $username;
}
}
}
return false;
}
if (!isLoggedIn()) {
header("Location: http://{$_SERVER['SERVER_NAME']}/login.php");
}
if(isset($_POST['profile'])) {
header("Location: https://{$_SERVER['SERVER_NAME']}/profile?id=$userid");
}
?>
<!DOCTYPE HTML>
<html>
<head>
<title>Catbin | Каталог мини-приложеий</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
<link rel="stylesheet" href="vendor-second.css">
<link rel="stylesheet" href="vendor.css">
<link rel="stylesheet" href="/assets/fonts/stylesheet.css">
<script data-ad-client="ca-pub-1559110670812414" async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Global site tag (gtag.js) - Google Analytics -->
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-174561723-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag(){dataLayer.push(arguments);}
gtag('js', new Date());
gtag('config', 'UA-174561723-1');
</script>
<script type="text/javascript" >
(function(m,e,t,r,i,k,a){m[i]=m[i]||function(){(m[i].a=m[i].a||[]).push(arguments)};
m[i].l=1*new Date();k=e.createElement(t),a=e.getElementsByTagName(t)[0],k.async=1,k.src=r,a.parentNode.insertBefore(k,a)})
(window, document, "script", "https://mc.yandex.ru/metrika/tag.js", "ym");
ym(66291088, "init", {
clickmap:true,
trackLinks:true,
accurateTrackBounce:true,
webvisor:true
});
</script>
<noscript><div><img src="https://mc.yandex.ru/watch/66291088" style="position:absolute; left:-9999px;" alt="" /></div></noscript>
<style>
body { background-color: #222226; font-family: Google Sans; }
@font-face {
font-family: 'Google Sans';
src: url('/assets/fonts/GoogleSans-Medium.eot');
src: local('Google Sans Medium'), local('GoogleSans-Medium'),
url('/assets/fonts/GoogleSans-Medium.eot?#iefix') format('embedded-opentype'),
url('/assets/fonts/GoogleSans-Medium.woff2') format('woff2'),
url('/assets/fonts/GoogleSans-Medium.woff') format('woff'),
url('/assets/fonts/GoogleSans-Medium.ttf') format('truetype');
font-weight: 500;
font-style: normal;
}
.background-accordion {
background-color: aliceblue;
}
.uk-accordion {
background-color: aliceblue;
}
.catbin-descp {
margin: 64px;
}
a, li, h1, h2, h3, h4, h5, h6, p, span {
color: aliceblue;
font-family: 'Google Sans';
}
a {
text-decoration: none;
}
a:hover {
color: #DADCE0;
}
.catbin-featch {
margin-right: 64px;
margin-left: 64px;
}
@media (min-width: 1025px) {
.updatelist {
margin-left: 100px;
margin-right: 100px;
} }
@media (min-width: 801px) {
.updatelist {
} }
@media (max-width: 1024px) {
.updatelist {
} }
</style>
<meta charset="UTF-8">
<meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">
</head>
<body oncontextmenu="return false" data-spy="scroll" data-target="#toc">
<header class="header header-sticky header-transparent" >
<div class="container">
<div class="row">
<nav class="navbar navbar-expand-lg navbar-dark">
<a class="navbar-brand" href="/">
<img src="/assets/img/catbintext.png" width="80" height="30" class="d-inline-block align-top" alt="" loading="lazy">
</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<div class="navbar-nav ml-auto">
<li class="nav-item active"></li>
<a class="nav-item nav-link" href="/">Главная</a>
<a class="nav-item nav-link" href="/community_videos">Видео о Catbin</a>
<?php
if (isLoggedIn()) { ?>
<a class="nav-item nav-link active" href="/welcome">Главное меню</a>
<a class="nav-item nav-link" href="/@<?php echo getUsername(); ?>">Профиль</a>
<?php
} else { ?>
<a class="nav-item nav-link" href="/login">Войти в CatbinID</a> <?php
} ?>
</div>
</nav>
</div>
</div>
</header>
<br><br>
<br><br><br>
<h3 class="catbin-descp">Прошлые обновления:</h3>
<br><br><br>
<hr>
<br><br><br>
<b><h4>Будьте как дома</h4></b><br>
<h5>В Catbin появилось новое меню, где вы можете запустить любой доступный сервис, узнать о новых обновлениях и многое другое.</h5>