コード例 #1
0
ファイル: class_parse.php プロジェクト: beporter/hlwhosonline
 function getint32(&$data)
 {
     if (empty($data)) {
         return "";
     }
     $lower = parse::getint16($data);
     $higher = parse::getint16($data);
     return $higher << 16 | $lower;
 }
コード例 #2
0
ファイル: index.php プロジェクト: mleo1/rAFluxCP
        $flieLoad->delete();
    } else {
        $errorMessage = $is_loaded;
    }
}
// upload and parse all npcs.
if ($files->get('npc_zip')) {
    $npc_zip = FLUX_ROOT . '/npc_zip.zip';
    $is_loaded = $flieLoad->load($files->get('npc_zip'), $npc_zip);
    if ($is_loaded === true) {
        $dirExtract = FLUX_ROOT . '/upload_npc';
        $zip = new ZipArchive();
        if ($zip->open($npc_zip) === true) {
            $zip->extractTo($dirExtract);
            $zip->close();
            $parse = new parse($server);
            $file = $parse->getFiles();
            $successMessage = 'Successfull load ' . sizeof($file) . ' files';
        } else {
            $errorMessage = 'file must be ZIP ARCHIVE';
        }
        if (sizeof($file) == 0) {
            $errorMessage = 'files in the archive not found';
        }
        $flieLoad->delete();
    } else {
        $errorMessage = $is_loaded;
    }
}
// get data from tables
$tables = array('`mob_spawns`' => 'MobSpawnBase', '`map_index`' => 'mapIndexBase', '`warps`' => 'warpsBase', '`npcs` where is_shop = 0' => 'npcsBase', '`npcs` where is_shop = 1' => 'shopsBase');
コード例 #3
0
 function rules($rule = "")
 {
     $this->getchallenge();
     $response = $this->communicate(A2S_RULES . $this->challenge);
     $control_byte = parse::getchar($response);
     //DEBUG	echo "control byte for rules is: {$control_byte}. ";
     if ($control_byte != S2A_RULES) {
         return FALSE;
     }
     $result = array();
     $count = parse::getint16($response);
     for ($i = 0; $i < $count; $i++) {
         $key = parse::getstring($response);
         $value = parse::getstring($response);
         $result[$key] = $value;
     }
     if (!empty($rule)) {
         return $result[$rule];
     }
     return $result;
 }
コード例 #4
0
                $title = textFilter($_POST['title'], false, true);
                $alt_name = totranslit($_POST['alt_name']);
                $text = $parse->BBparse(textFilter($_POST['text']));
                if (isset($title) and !empty($title) and isset($text) and !empty($text) and isset($alt_name) and !empty($alt_name)) {
                    $db->query("UPDATE`" . PREFIX . "_static` SET alt_name = '" . $alt_name . "', title = '" . $title . "', text = '" . $text . "' WHERE id = '" . $id . "'");
                    header("Location: ?mod=static");
                } else {
                    msgbox('Ошибка', 'Все поля обязательны к заполнению', 'javascript:history.go(-1)');
                }
                die;
            }
            echoheader();
            $row['title'] = stripslashes($row['title']);
            //Подключаем парсер
            include_once ENGINE_DIR . '/classes/parse.php';
            $parse = new parse();
            $row['text'] = $parse->BBdecode(myBrRn(stripslashes($row['text'])));
            echohtmlstart('Редактирование страницы');
            echo <<<HTML
<form method="POST" action="">

<style type="text/css" media="all">
.inpu{width:458px;}
textarea{width:300px;height:300px;}
</style>

<div class="fllogall" style="width:130px">Заголовок:</div><input class="inpu" type="text" name="title" value="{$row['title']}" /><div class="mgcler"></div>

<div class="fllogall" style="width:130px">Адрес: (например <b>test</b>):</div><input class="inpu" type="text" name="alt_name" value="{$row['alt_name']}" /><div class="mgcler"></div>

<div class="fllogall" style="width:130px">Текст:</div><textarea class="inpu" name="text">{$row['text']}</textarea><div class="mgcler"></div>
コード例 #5
0
ファイル: make_csv.php プロジェクト: soudai/benchmark_parser
<?php

require_once './model/file.php';
require_once './model/parse.php';
$view = isset($_GET['view']) ? $_GET['view'] : 'pg9.3';
$list = ['pg9.3' => 'pg-9.3.5', 'MySQL' => 'my', 'MariaDB' => 'maria', 'pg9.4' => 'pg-9.4.0'];
$path = isset($list["{$view}"]) ? $list["{$view}"] : 'pg-9.3.5';
$file = new file($path);
$parse = new parse($file);
$parse_delete_date = $parse->get();
ksort($parse_delete_date);
$fp = fopen('php://temp', 'r+b');
fputcsv($fp, $fields);
$header[] = "全実行時間(sec.)";
$header[] = "r";
$header[] = "b";
$header[] = "buff";
$header[] = "cache";
$header[] = "bi";
$header[] = "bo";
$header[] = "in";
$header[] = "cs";
$header[] = "us";
$header[] = "sy";
$header[] = "id";
$header[] = "wa";
fputcsv($fp, $header);
foreach ($parse_delete_date as $file_name => $value) {
    unset($fields);
    $fields[] = $file_name;
    $fields[] = $value['out_parse_data']["全実行時間(sec.):"];
コード例 #6
0
ファイル: blog.php プロジェクト: BGCX067/facestor-svn-to-git
             $tpl->compile('content');
         } else {
             Hacking();
         }
     } else {
         Hacking();
     }
     break;
     //################### Сохранение отредактированых ###################//
 //################### Сохранение отредактированых ###################//
 case "save":
     NoAjaxQuery();
     if ($user_group[$user_info['user_group']]['addnews']) {
         //Подключаем парсер
         include ENGINE_DIR . '/classes/parse.php';
         $parse = new parse();
         $title = ajax_utf8(textFilter($_POST['title'], false, true));
         $text = $parse->BBparse(ajax_utf8(textFilter($_POST['text'])));
         $id = intval($_POST['id']);
         function BBimg($source)
         {
             return "<img src=\"{$source}\" alt=\"\" />";
         }
         $text = preg_replace("#\\[img\\](.*?)\\[/img\\]#ies", "\\BBimg('\\1')", $text);
         if (isset($title) and !empty($title) and isset($text) and !empty($text)) {
             $db->query("UPDATE `" . PREFIX . "_blog` SET title = '{$title}', story = '{$text}' WHERE id = '{$id}'");
         }
     }
     die;
     break;
     //################### Загрузка фотографии ###################//
コード例 #7
0
ファイル: class.main.php プロジェクト: entropie/Jamp
 function parseXmlFile($file, $str)
 {
     $file = $this->checkfileSlash($this->cfg['style']) . $file;
     include './libraries/class.parse.php';
     $c = new parse($file);
     $content = $c->getLoopStr($str);
     return array("main" => $content['main'], "loop" => $content['loop']);
 }
コード例 #8
0
ファイル: get.php プロジェクト: mleo1/rAFluxCP
<?php

if (!defined('FLUX_ROOT')) {
    exit;
}
error_reporting(0);
function rmdirs($dir)
{
    if ($objs = glob($dir . '/*')) {
        foreach ($objs as $obj) {
            is_dir($obj) ? rmdirs($obj) : unlink($obj);
        }
    }
    rmdir($dir);
}
if ($params->get('type') == 'delDir') {
    rmdirs(FLUX_ROOT . '/upload_npc');
    die;
}
require_once 'Flux/ParseNPC.php';
$file = $params->get('file_name');
try {
    $parse = new parse($server);
    $data = array('isError' => false, 'data' => $parse->loadFiles(array($file)));
} catch (Exception $e) {
    $data = array('isError' => true, 'data' => $e->getMessage());
}
$data['file'] = $file;
$data['file_short'] = array_pop(explode('/', str_replace('\\', '/', $file)));
echo json_encode($data);
die;
コード例 #9
0
ファイル: notes.php プロジェクト: BGCX067/facestor-svn-to-git
/* 
	Appointment: Заметки
	File: notes.php
*/
if (!defined('MOZG')) {
    die('Hacking attempt!');
}
//Редактирование
if ($_GET['act'] == 'edit') {
    $note_id = intval($_GET['id']);
    //SQL Запрос на вывод информации о заметке
    $row = $db->super_query("SELECT title, full_text FROM `" . PREFIX . "_notes` WHERE id = '" . $note_id . "'");
    if ($row) {
        //Подключаем парсер
        include ENGINE_DIR . '/classes/parse.php';
        $parse = new parse();
        if (isset($_POST['save'])) {
            $title = textFilter($_POST['title'], false, true);
            $text = $parse->BBparse(textFilter($_POST['full_text']));
            if (isset($title) and !empty($title) and isset($text) and !empty($text)) {
                $db->query("UPDATE `" . PREFIX . "_notes` SET title = '" . $title . "', full_text = '" . $text . "' WHERE id = '" . $note_id . "'");
                msgbox('Информация', 'Заметка успешно сохранена', '?mod=notes');
            } else {
                msgbox('Ошибка', 'Заполните все поля', '?mod=notes&act=edit&id=' . $note_id);
            }
        } else {
            $row['title'] = stripslashes($row['title']);
            $row['full_text'] = $parse->BBdecode(stripslashes(myBrRn($row['full_text'])));
            echoheader();
            echohtmlstart('Редактирование заметки');
            echo <<<HTML
コード例 #10
0
ファイル: parser.php プロジェクト: bradz/bradzevo2
include 'includes/sidebar.inc.php';
echo "</td><td class=\"content\">";
// main content title
echo "<div class=\"content_header\">PARSER <strong>&laquo;</strong></div>";
/*
 * MAIN CONTENT STARTS HERE ***************************************************
 */
echo "<div class=\"content_subheader\">PASTE MISSIONS OR GALAXY STATUS <strong>&laquo;</strong></div>";
if (!isset($_POST['parse'])) {
    echo "<div class=\"content_item\" style=\"text-align: center;\">";
    echo "<br />";
    echo "<form action=\"\" method=\"post\">";
    echo "<textarea name=\"parse\" rows=\"5\" cols=\"60\" />";
    echo "</textarea>";
    echo "<br /><br />";
    echo "<input type=\"submit\" />";
    echo "</form>";
    echo "</div>";
} else {
    $parse = new parse($_POST['parse'], $my_user_id);
    $parse->process_parse();
    echo $parse->get_feedback();
}
/*
 * MAIN CONTENT ENDS HERE *****************************************************
 */
// close main table
echo "</td></tr></table>";
// footer
include 'includes/footer.inc.php';
include 'includes/footer_html.inc.php';
コード例 #11
0
ファイル: insert.php プロジェクト: pombredanne/vulnDB
 public function running_scans($xml_v1, $xml_v2, $account_name)
 {
     $now = date('c');
     $parsed = parse::running_scans($xml_v1, $xml_v2, $account_name, $now);
     $insert = $this->insert(SCANS_RUNNING_TABLE, $parsed);
     return $insert;
 }
コード例 #12
0
ファイル: vdb_updater.php プロジェクト: pombredanne/vulnDB
$vulndb = Model::factory('vulndb_main');
Logger::msg('info', array('message' => 'Starting the vulnDB updater'));
$accounts = $vulndb->getaccounts();
foreach ($accounts as $account) {
    $now = date('c');
    $account_name = $account['account'];
    $username = $account['username'];
    $password = CryptAES::decrypt($account['password']);
    $url1 = 'https://' . $account['api_url'] . '/msp/';
    $url2 = 'https://' . $account['api_url'] . '/api/2.0/fo/';
    $api1 = new QualysAPI_v1();
    $api2 = new QualysAPI_v2($url2, $username, $password);
    Logger::msg('info', array('account' => $account_name, 'message' => "starting with account {$account_name}"));
    Logger::msg('info', array('account' => $account_name, 'message' => "polling scan list", 'timeframe' => $timeframe, 'api_call' => 'pollscans', 'api_version' => 2));
    $scanlist_xml = $api2->pollscans($timeframe);
    $scanlist = parse::scanlist($scanlist_xml);
    $scans_in_vulndb = $vulndb->getscans($account_name);
    // Filter out the scans we already have vulnDB and move onto scans we need to get
    $scans_to_get = $vulndb->prunescanlist($scanlist, $account_name);
    // Lets get those scans
    if (count($scans_to_get)) {
        foreach ($scans_to_get as $scan_to_get) {
            $scanstatus = $scan_to_get['SCAN_STATUS'];
            $scanid = (string) $scan_to_get['SCAN_ID'];
            $scantitle = (string) $scan_to_get['SCAN_TITLE'];
            $scandate = (string) $scan_to_get['SCAN_DATE'];
            $scantypestoget = $vdb_config['scan_types_to_get'];
            if (in_array($scanstatus, $scantypestoget)) {
                Logger::msg('info', array('account' => $account_name, 'message' => "downloading scan", 'scan_id' => $scanid, 'scan_title' => $scantitle, 'scan_date' => $scandate));
                $filename = "{$account_name}-" . str_replace("/", "_", $scanid) . ".csv";
                $report_path = REPORTPATH . DIRECTORY_SEPARATOR . $account_name;