Exemplo n.º 1
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 31.01.16
 * Time: 11:03
 */
config::$page = "Страницу не найдено";
Exemplo n.º 2
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 05.02.16
 * Time: 16:21
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Добавить изображение";
if (isset($_POST['sub']) && isset($_FILES)) {
    $files = $_FILES;
    //print_r($files);
    $file = new load($_POST['cat'], $files, $_POST['title'], $_POST['table']);
    unset($file);
}
Exemplo n.º 3
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 31.01.16
 * Time: 10:29
 */
$config::$menu = "contact";
config::$page = "Контакты";
Exemplo n.º 4
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 04.02.16
 * Time: 16:14
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Редактор блога";
$db = new DB();
$res = $db->select("articles", "*");
unset($db);
Exemplo n.º 5
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 06.02.16
 * Time: 15:41
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['activate'] !== "1") {
    header("Location: /main");
    exit;
}
config::$page = "Профиль пользователя " . $_SESSION['user']['login'];
//Смена логина
if (isset($_POST['sub']) && $_POST['captcha'] == $_SESSION['captcha']) {
    $update_login = new User();
    $passwords = $update_login->check_password($_POST['password']);
    if ($_POST['password'] !== $_POST['password1'] || $_SESSION['user']['password'] !== $passwords) {
        $_SESSION['user_error_pass'] = "******";
        return false;
    }
    $login = $update_login->check_login($_POST['login']);
    if ($login === false) {
        $_SESSION['user_error_login'] = "******";
        return false;
    }
    $row = array();
    $row['login'] = $_POST['login'];
    $row['password'] = $passwords;
    $success = $update_login->update_user($row);
    unset($update_login);
Exemplo n.º 6
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 01.02.16
 * Time: 13:44
 */
$config::$menu = "login";
config::$page = "Авторизация";
if (isset($_POST['sub']) && $_POST['captcha'] == $_SESSION['captcha']) {
    $login = new UserTools();
    $login->login($_POST);
} elseif (isset($_POST['sub']) && $_POST['captcha'] !== $_SESSION['captcha']) {
    $_SESSION['reg_error_captcha'] = "Не верный код капчи";
}
//echo $_COOKIE['auth'];
Exemplo n.º 7
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 07.02.16
 * Time: 0:43
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Пользователи";
$db = new DB();
$res = $db->select("user", "*", "", "", "login", "ASC");
if (isset($_GET['key1'])) {
    $res = $db->select("user", "*", "permissions," . $_GET['key1'], "", "login", "ASC");
}
if (isset($_POST['sub_user']) && $_POST['captcha'] == $_SESSION['captcha']) {
    $user = new User();
    $success = $user->get_user($_POST);
    if ($success !== false) {
        header("location: /admin/user");
        exit;
    }
} elseif (isset($_POST['sub_user']) && !$_POST['captcha'] == $_SESSION['captcha']) {
    $_SESSION['reg_error_captcha'] = "Не верный код капчи";
}
unset($db);
Exemplo n.º 8
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 04.02.16
 * Time: 15:57
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Статистика";
$db = new DB();
$res = $db->select("stats_ip", "*", "id_user," . $_GET['key1']);
//print_r($res);
Exemplo n.º 9
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 31.01.16
 * Time: 10:29
 */
$config::$menu = "portfolio";
config::$page = "Портфолио";
$db = new DB();
$res = $db->select("portfolio", "*");
unset($db);
Exemplo n.º 10
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 04.02.16
 * Time: 17:29
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Редактировать статью";
$id_article = $_GET['key1'];
$db = new DB();
$res = $db->select("articles", "*", "id," . $id_article);
//print_r($res);
if (isset($_POST['sub'])) {
    $k = "id";
    $up_article = $db->update("articles", $_POST, $k, $id_article);
    if ($up_article) {
        $_SESSION['up_article'] = "Статья успешно обновлена";
    } else {
        $_SESSION['up_article'] = "Ошибка при обновлении";
    }
}
unset($db);
Exemplo n.º 11
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 27.01.16
 * Time: 21:00
 */
config::$page = "Подтверждение кода активации";
if (isset($_GET['key1'])) {
    $res = array();
    $res['activate'] = 1;
    $db = new DB();
    $activate = $db->update("user", $res, "activ_code", $_GET['key1']);
    if ($activate) {
        $_SESSION['active'] = "Account Activate!";
    } else {
        $_SESSION['active'] = "Произошла ошибка при активации";
    }
    if (isset($_SESSION['active'])) {
        header("Location: /reg/regactivate");
        exit;
    }
}
Exemplo n.º 12
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 04.02.16
 * Time: 16:28
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Добавить статью";
if (isset($_POST['sub'])) {
    $db = new DB();
    $success = $db->insert("articles", $_POST);
    if (isset($success)) {
        $_SESSION['article_success'] = "Статья успешно добавлена";
    }
    unset($db);
}
Exemplo n.º 13
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 31.01.16
 * Time: 10:29
 */
$config::$menu = "blog";
config::$page = "Блог";
$db = new DB();
$res = $db->select("articles", "*");
unset($db);
Exemplo n.º 14
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 05.02.16
 * Time: 11:22
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Редактировать портфолио";
$db = new DB();
$res = $db->select("portfolio", "*");
if (empty($res)) {
    $_SESSION['not_image'] = "Not image";
} else {
    unset($_SESSION['not_image']);
}
if (isset($_GET['key1'])) {
    $success = $db->delete("portfolio", "id", $_GET['key1']);
    if ($success === false) {
        $_SESSION['del_error'] = "Ошибка при удалиении";
        header("Location: /admin/portfolio-edit");
        exit;
    } else {
        $_SESSION['del_error'] = "Успешно удалено";
        header("Location: /admin/portfolio-edit");
        exit;
    }
Exemplo n.º 15
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 01.02.16
 * Time: 13:22
 */
config::$page = "Регистрация";
$config::$menu = "reg";
if (isset($_POST['sub']) && $_POST['captcha'] == $_SESSION['captcha']) {
    $user = new User();
    $user->get_user($_POST);
} elseif (isset($_POST['sub']) && !$_POST['captcha'] == $_SESSION['captcha']) {
    $_SESSION['reg_error_captcha'] = "Не верный код капчи";
}
Exemplo n.º 16
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 31.01.16
 * Time: 10:29
 */
$config::$menu = "about";
config::$page = "О нас";
Exemplo n.º 17
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 07.02.16
 * Time: 15:12
 */
if (!isset($_SESSION['user']) || $_SESSION['user']['permissions'] !== "5") {
    header("Location: /main");
    exit;
}
config::$page = "Редактировать пользователя";
if (isset($_GET['key1'])) {
    $db = new DB();
    $res = $db->select("user", "*", "id," . $_GET['key1']);
}
if (isset($_POST['permissions_sub'])) {
    $row = array();
    $row['permissions'] = $_POST['select'];
    $db->update("user", $row, "id", $_GET['key1']);
    header("location: /admin/user-edit/" . $_GET['key1']);
    exit;
}
if (isset($_POST['activate'])) {
    $row = array();
    $row['activate'] = $_POST['select_activate'];
    $db->update("user", $row, "id", $_GET['key1']);
    header("location: /admin/user-edit/" . $_GET['key1']);
    exit;
}
Exemplo n.º 18
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 31.01.16
 * Time: 10:29
 */
$config::$menu = "main";
config::$page = "Главная";
Exemplo n.º 19
0
<?php

/**
 * Created by PhpStorm.
 * User: Alexandr
 * Date: 07.02.16
 * Time: 16:44
 */
if (isset($_GET['key1'])) {
    $db = new DB();
    $res = $db->select("articles", "*", "id," . $_GET['key1']);
}
config::$page = $res[0]['title'];