/** * 初期化を行う * @param array $config * @throws NosupportDriverException */ protected function init(array $config) { if (!class_exists('mysqli')) { throw new NosupportDriverException('mysqli class not found'); } $this->mysql = new \mysqli(); foreach (array('host', 'user', 'password', 'database', 'port', 'socket') as $value) { if (!isset($config[$value])) { $config[$value] = null; } } // ホストの指定が無い場合 if (empty($config['host'])) { $config['host'] = 'localhost'; } // ユーザーの指定が無い if (empty($config['user'])) { $config['user'] = '******'; } // DBの指定が無い場合 if (empty($config['database'])) { $config['database'] = $this->database; } else { $this->database = $config['database']; } // テーブル名が指定されてたら if (issset($config['table'])) { $this->table = $config['table']; } $this->mysql = new \mysqli($config['host'], $config['user'], $config['password'], $config['dataabse'], $config['port'], $config['socket']); if ($this->mysql->connect_error) { throw new NosupportDriverException('mysql connect error'); } $this->isSupported = true; return true; }
$disabled_rules_log = "{$if_friendly}_disabled_preproc_rules.log"; // Check for returned "selected alias" if action is import if ($_GET['act'] == "import" && isset($_GET['varname']) && !empty($_GET['varvalue'])) { // Retrieve previously typed values we passed to SELECT ALIAS page $pconfig['sf_portscan'] = htmlspecialchars($_GET['sf_portscan']) ? 'on' : 'off'; $pconfig['pscan_ignore_scanners'] = htmlspecialchars($_GET['pscan_ignore_scanners']); $pconfig['pscan_protocol'] = htmlspecialchars($_GET['pscan_protocol']); $pconfig['pscan_type'] = htmlspecialchars($_GET['pscan_type']); $pconfig['pscan_memcap'] = htmlspecialchars($_GET['pscan_memcap']); $pconfig['pscan_sense_level'] = htmlspecialchars($_GET['pscan_sense_level']); // Now retrieve the "selected alias" returned from SELECT ALIAS page $pconfig[$_GET['varname']] = htmlspecialchars($_GET['varvalue']); } // Handle deleting of any of the multiple configuration engines if ($_POST['del_http_inspect']) { if (isset($_POST['eng_id']) && isset($id) && issset($a_nat[$id])) { unset($a_nat[$id]['http_inspect_engine']['item'][$_POST['eng_id']]); write_config("Snort pkg: deleted http_inspect engine for {$a_nat[$id]['interface']}."); header("Location: snort_preprocessors.php?id={$id}#httpinspect_row"); exit; } } elseif ($_POST['del_frag3']) { if (isset($_POST['eng_id']) && isset($id) && isset($a_nat[$id])) { unset($a_nat[$id]['frag3_engine']['item'][$_POST['eng_id']]); write_config("Snort pkg: deleted frag3 engine for {$a_nat[$id]['interface']}."); header("Location: snort_preprocessors.php?id={$id}#frag3_row"); exit; } } elseif ($_POST['del_stream5_tcp']) { if (isset($_POST['eng_id']) && isset($id) && isset($a_nat[$id])) { unset($a_nat[$id]['stream5_tcp_engine']['item'][$_POST['eng_id']]);
} echo "</pre>"; ?> <?php echo "<pre>"; if (issset($bcount_value)) { print_r($bcount_value); } echo "</pre>"; ?> <?php echo "<pre>"; if (issset($dcount_value)) { print_r($dcount_value); } echo "</pre>"; ?> <?php // echo "<pre>"; // if(isset($ust)){ echo $ust; echo "<br>"; echo $ost;} // echo "</pre>"; ?> <?php //echo $lmt; echo $idx; ?>