Файл: index.php
Строк: 87
<?php
session_start();
error_reporting(E_ALL^E_DEPRECATED);
include "sys/system.page.php";
include "sys/system.db.php";
include "sys/system.auth.php";
include "sys/system.users.php";
class Page {
var $gen;
var $auth;
var $db;
var $users;
function __construct() {
global $gen;
global $auth;
global $db;
global $users;
$gen = new PageGenerator();
$db = new Database;
$auth = new Authorization;
$users = new Users;
}
function Render() {
global $gen;
global $auth;
global $db;
global $users;
if($auth->GetUserRights($db) == "Парится в баньке") {
$gen->CreateText("<b style="color: red">У вас нет доступа к этой странице</b>");
$gen->CreateLinkWithIcon("close", "Выйти", "logout.php");
exit;
}
if($auth->IsUserAuthorized()) {
$gen->CreateLinkWithIcon("home", "Мой профиль", "profile.php?id=" . $auth->GetUserID($db, $_SESSION["username"]));
//$gen->CreateLinkWithIcon("envelope", "Мои сообщения", "message.php");
$gen->CreateLinkWithIcon("close", "Выход", "logout.php");
} else {
$gen->CreateLinkWithIcon("key", "Войти", "login.php");
$gen->CreateLinkWithIcon("user-plus", "Регистрация", "register.php");
}
$gen->CreateLinkWithIcon("comment", "Чат", "chat.php");
$gen->CreateLinkWithIcon("user", "Пользователи", "users.php");
$gen->CreateText("Файловый архив:");
$gen->CreateLinkWithIcon("file-zip-o", "Программы", "zo.php?razdel=programs");
$gen->CreateLinkWithIcon("gamepad", "Игры", "games.php");
$gen->CreateLinkWithIcon("music", "Музыка", "zo.php?razdel=music");
$gen->CreateLinkWithIcon("file-image-o", "Фото", "zo.php?razdel=photo");
$gen->CreateText("Ссылки:");
$gen->CreateLinkWithIcon("link", "Контакты", "profile.php");
$gen->CreateLinkWithIcon("github", "Движок сайта", "http://github.com/monobogdan/novasocial");
if($auth->GetUserRights($db) == "Администратор" or $auth->GetUserRights($db) == "Создатель") {
$gen->CreateLinkWithIcon("wrench", "Админка", "admin.php");
}
$gen->CreateText("Зарегистрировано пользователей: " . $users->GetUserCount($db));
}
}
$index = new Page;
$index->Render();
?>