Example #1
0
<?php

$dir = dirname(__FILE__) . "/";
include_once $dir . "config.php";
include_once $dir . "class/System.class.php";
include_once $dir . "class/Database.class.php";
include_once $dir . "class/Errors.class.php";
include_once $dir . "class/Notification.class.php";
if (isset($_POST["action"])) {
    //Проверяем пароль
    if ($_POST["action"] == "enter") {
        $password = md5($_POST["password"]);
        $count = Database::countCredentials($password);
        if ($count == 1) {
            session_start();
            $_SESSION["TM"] = $password;
            $return["error"] = FALSE;
        } else {
            $return["error"] = TRUE;
            $return["msg"] = 'Неверный пароль!';
        }
        echo json_encode($return);
    }
    //Добавляем тему для мониторинга
    if ($_POST["action"] == "torrent_add") {
        if ($url = parse_url($_POST["url"])) {
            $tracker = $url["host"];
            $tracker = preg_replace('/www\\./', '', $tracker);
            if ($tracker == 'tr.anidub.com') {
                $tracker = 'anidub.com';
            }