Skip to content

Instantly share code, notes, and snippets.

# site
server {
listen 80;
server_name site.com www.site.com;
root /home/webserver/var/www/html/site/app;
index index.php index.html index.htm;
charset utf-8;
#access_log //home/webserver/var/www/html/site/logs/host.access.log main;
client_max_body_size 75M;
public function auth($login, $passwors) {
$query = pg_query("SELECT password,role FROM subsbl.user WHERE login='$login' ") or die('Ошибка запроса: ' . pg_last_error());
$result = pg_fetch_assoc($query);
//var_dump($result);
if($result['password'] == md5(md5($passwors))) {
$_SESSION["is_auth"] = true; //Делаем пользователя авторизованным
$_SESSION["login"] = $login; //Записываем в сессию логин пользователя
$query2 = pg_query("SELECT permissions FROM subsbl.roles WHERE id='$result[role]' ") or die('Ошибка запроса: ' . pg_last_error());
$result2 = pg_fetch_assoc($query2);
<?php session_start();
if((array_search('read_page', $_SESSION['permissions']) !== false) and ($_SESSION["is_auth"] === true)) ?>
<div class="tabs">
<div id="tab-1" class="tab">
<article>
<div class="text-section">
<h1>Главная страница</h1>
<p>This is a quick overview of some features</p>
</div>
<ul class="states">