Example #1
0
 /**
  * @covers Csfd\Repositories\Repository::setContainer
  */
 public function testSetContainer()
 {
     $e = Access($this->repo);
     $container = $this->getMockContainer();
     $e->setContainer($container);
     $this->assertSame($e->container, $container);
 }
Example #2
0
 /** @covers Csfd\Networking\Request::getStatusCode() */
 public function testGetStatusCode()
 {
     $this->assertInternalType('integer', $this->request->getStatusCode());
     $e = Access($this->request);
     $e->statusCode = 200;
     $this->assertSame(200, $this->request->getStatusCode());
 }
Example #3
0
 /**
  * @covers Csfd\Networking\UrlBuilder::validate()
  */
 public function testValidate()
 {
     $e = Access($this->getUrlBuilder());
     $this->assertFalse($e->validate([]));
     $this->assertFalse($e->validate(['root' => []]));
     $this->assertTrue($e->validate(['root' => 'http://localhost']));
 }
Example #4
0
 /** @covers Csfd\Entities\Entity::getRepository */
 public function testGetRepository_byName()
 {
     $e = Access($this->entity);
     $repo = $this->getUsersRepository();
     $repo->setContainer($this->getMockContainer());
     $e->setRepository($repo);
     $this->assertInstanceOf('Csfd\\Repositories\\Authors', $e->getRepository('authors'));
 }
 /**
  * e.g. SQL explain
  *
  * @return NULL|Html|string
  */
 public function getInfo()
 {
     $hack = Access($this->command, 'getData');
     $html = $this->formatVars($hack->call()['params']);
     return Html::el()->setHtml($html);
 }
<?php

Access(1);
$title = 'Пополнение баланса';
$menu_id = 'balance';
if (isset($_GET['status']) && !empty($_GET['status'])) {
    if (isset($_GET['payment']) && !empty($_GET['payment'])) {
        $payment = $_GET['payment'];
    } else {
        $payment = 'UNDEFINED';
    }
    switch ($_GET['status']) {
        case 'success':
            MessageSend(3, 'Вы успешно пополнили баланс через ' . $payment . '!', '/balance/');
            break;
        case 'fail':
            MessageSend(1, 'При пополнении счёта через ' . $payment . ' произошла ошибка!', '/balance/');
            break;
        case 'waiting':
            MessageSend(2, $payment . ': ожидает подтверждение платежа...', '/balance/');
            break;
        default:
            MessageSend(1, 'UNDEFINED_MESSAGE', '/balance/');
            break;
    }
} else {
    ob_start();
    include SITE_ROOT . 'style/balance/index.html';
    $content_main = ob_get_clean();
}
    */
	body {
		background-color: #fff;
		padding: 10px;
		font-family: Lucida Grande, Verdana, Sans-serif;
		font-size: 12px;
		color: #000;
	}

</style>
</head>
<body>
    <div id="content">

    	<h1>Hello,</h1>

        <div id="message">
			<?php 
echo $message_body;
?>
		</div>

        <hr />
        <p>Thank you,<br />
        <?php 
echo anchor('', Access()->reg_site_name);
?>
.</p>
	</div>
</body>
</html>
/* 1.该软件个人非商业用途免费使用.
/* 2.免费使用禁止修改版权信息和官方推广链接.
/* 3.禁止任何衍生版本.
/* ---------------------------------------------------- */
$pageName = 'index';
/**----------------
 * include common files
 */
$incPath = dirname(__FILE__);
require_once "{$incPath}/inc/init.php";
error_reporting(0);
header('Content-Type: text/html; charset=utf-8');
define('IN_NIUXAMS', true);
define('NIUXAMS_VER', '2.12');
require 'config.php';
require 'subadmin.php';
require 'common.func.php';
$datadir = 'data';
$time_start = getmicrotime();
defined('NIUXAMS_LOGIN') or Access();
$timezone = $timezone ? $timezone : 'Asia/Shanghai';
date_default_timezone_set($timezone);
$cloudurl = 'http://www.niuxsoft.com/niuxams/cloud/';
if (function_exists('spl_autoload_register')) {
    spl_autoload_register('autoload');
} else {
    function __autoload($class)
    {
        return autoload($class);
    }
}
Example #9
0
 /**
  * @covers Csfd\Networking\UrlAccess::getConfigKeys()
  */
 public function testGetConfigKeys()
 {
     $entity = new Movie($this->getMockAuthenticator(), $this->getMockUrlBuilder(), new Parsers\Movie(), $this->getMockRequestFactory(), 1);
     $e = Access($entity);
     $this->assertSame(['entities', 'movie'], $e->getConfigKeys());
 }
Example #10
0
 /**
  * @covers Csfd\Search::getResult()
  */
 public function testGetResult()
 {
     $e = Access($this->search);
     $this->assertInstanceOf('Csfd\\Networking\\Request', $e->getResult('query'));
 }
Example #11
0
 /** @covers Csfd\Parsers\Parser::normalizeUrl() */
 public function testNormalizeUrl()
 {
     $e = Access($this->parser);
     $in = '//img.csfd.cz/files/images/user/avatars/158/155/158155401_a5d9bc.jpg';
     $exp = 'http://img.csfd.cz/files/images/user/avatars/158/155/158155401_a5d9bc.jpg';
     $this->assertSame($exp, $e->normalizeUrl($in));
 }
<?php

Access(0);
SiteRefer();
if (isset($_POST['login']) && isset($_POST['password']) && isset($_POST['email'])) {
    if (!$_REQUEST['rules-accept']) {
        MessageSend(1, 'Вы не приняли правила сервера!', '/register/');
    }
    $login = TextSave($_POST['login']);
    $pass = TextSave($_POST['password']);
    $email = TextSave($_POST['email']);
    /* Проверки */
    if (strlen($login) > 16) {
        MessageSend(1, 'Логин должен содержать не более 16 символов.', '/register/');
    }
    if (strlen($pass) > 30) {
        MessageSend(1, 'Пароль должен содержать не более 30 символов.', '/register/');
    }
    if (strlen($email) > 50) {
        MessageSend(1, 'E-Mail должен содержать не более 50 символов.', '/register/');
    }
    if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
        MessageSend(1, 'Невалидный E-Mail!', '/register/');
    }
    if (strlen($login) < 3) {
        MessageSend(1, 'Логин должен содержать не менее 3 символов.', '/register/');
    }
    if (strlen($pass) < 5) {
        MessageSend(1, 'Пароль должен содержать не менее 5 символов.', '/register/');
    }
    if (empty($email)) {
Example #13
0
 /** @covers Csfd\Entities\User::getUrlKey() */
 public function testRequest()
 {
     $e = Access($this->entity);
     $this->assertInternalType('string', $e->getUrlKey('any property'));
 }
<?php

/**
Статусы:
1 - На модерации
2 - Онлайн
3 - Оффлайн
4 - Скрыт
*/
Access(20);
$title = 'Стримы';
$menu_id = '';
if (isset($_GET['do']) && $_GET['do'] == 'add') {
    if (isset($_POST['stream-streamer']) && isset($_POST['stream-about']) && $_POST['stream-add']) {
        $streamStreamer = TextSave($_POST['stream-streamer']);
        $streamTitle = TextSave($_POST['stream-title'], 2);
        $streamAbout = TextSave($_POST['stream-about']);
        if (strlen($streamStreamer) < 3 or strlen($streamStreamer) > 50) {
            MessageSend(1, 'Логин Twitch.TV должен быть более 3 символов и не более 50 символов!');
        }
        if (strlen($streamTitle) < 5 or strlen($streamTitle) > 25) {
            MessageSend(1, 'Название стрима должно быть более 5 символов и не более 25 символов!');
        }
        if (strlen($streamAbout) > 400) {
            MessageSend(1, 'Описание должно быть не более 400 символов!');
        }
        $db = new DB();
        $db->connect("STREAM_ADD");
        $Row = $db->fetch_assoc($db->execute("SELECT `streamer` FROM `streams` WHERE `creator` = '" . $player['id'] . "'"));
        if (!empty($Row['streamer'])) {
            $db->close();
        }
        $p = $_GET['p'];
        $p = TextSave($p);
        if (!ctype_digit($p) or $p > $total) {
            $p = "1";
        }
        // формируем запрос
        $first = $p * $items_on_page - $items_on_page;
        $result = $db->execute("SELECT * FROM `shop` WHERE `type` = 1 ORDER BY `name` ASC LIMIT {$first}, {$items_on_page}");
        $db->close();
        ob_start();
        include SITE_ROOT . 'style/admin/shop/list.html';
        $content_main = ob_get_clean();
    }
} elseif (isset($_GET['apage']) && $_GET['apage'] == 'streams') {
    Access(8);
    if (isset($_GET['do']) && $_GET['do'] == 'edit') {
        if (isset($_POST['stream-title']) && isset($_POST['stream-about']) && isset($_POST['stream-id']) && isset($_POST['submit-button'])) {
            $stream_title = TextSave($_POST['stream-title']);
            $stream_about = $_POST['stream-about'];
            $streamID = (int) $_POST['stream-id'];
            if (empty($stream_title) || empty($stream_about)) {
                MessageSend("Все поля обязательны к заполнению!");
            }
            if (strlen($stream_title) < 5 or strlen($stream_title) > 25) {
                MessageSend(1, 'Название стрима должно быть более 5 символов и не более 25 символов!');
            }
            if (strlen($stream_about) > 400) {
                MessageSend(1, 'Описание должно быть не более 400 символов!');
            }
            $db = new DB();